Solved

Another Excel ? Multi Worksheets

Posted on 2011-02-24
8
169 Views
Last Modified: 2012-05-11
I now have three worksheets

Cover - the glossy view of sums
data - raw data of job entries
monthly - monthly budget for jobs
xhour - hours spent on each job

the question is I would like to fill a cell on Cover with the sum of all hours in xhour but the kicker is need to do it by segment.  There is a one to one corelation between job ids in xhour and monthly but on monthly there is a column called segment.

So for segment = walmart match all soebel IDs from Monthly to xhours and sum hours.
0
Comment
Question by:Matt Pinkston
  • 4
  • 2
  • 2
8 Comments
 
LVL 33

Expert Comment

by:jppinto
Comment Utility
You could use SUMPRODUCT() function to sum based on conditions. Have a look at my article that explains the principles of this function:

http://excel-user.blogspot.com/2009/10/sumproduct-sum-values-based-on.html

Or if you have Excel 2010 you could try SUMIFS():

http://excel-user.blogspot.com/2011/02/sumif-and-sumifs-functions.html

jppinto
0
 
LVL 33

Expert Comment

by:jppinto
Comment Utility
If you need aditional help, you could post a sample sheet for us to take a look.

jppinto
0
 

Author Comment

by:Matt Pinkston
Comment Utility
here is a sample file test.xlsx
0
 
LVL 50

Expert Comment

by:barry houdini
Comment Utility
Hello pinkstonmp, you want a formula for B3? What should the result be for your sample, I can't work out if you are taking numbers from monthly or xhours or both....

regards, barry
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 50

Expert Comment

by:barry houdini
Comment Utility
as a starting point this formula will sum the values in xhours in the rows where the job matches the "walmart jobs" in the data sheet

=SUM(IF(ISNUMBER(MATCH(xhours!A2:A5,IF(data!C2:C5="walmart",data!A2:A5),0)),xhours!B2:B5))

it's an "array formula" that needs to be confirmed with CTRL+SHIFT+ENTER so that curly braces appear around the formula, see attached

regards, barry
26845779.xlsx
0
 

Author Comment

by:Matt Pinkston
Comment Utility
tried this and it did not work:
=SUM(IF(ISNUMBER(MATCH(hours!A2:A25000,IF(data!H2:H5000="defense",data!B2:B5000),0)),hours!I2:I25000))

Updated xls to match  testx.xlsx testx.xlsx
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
Comment Utility
That formula works for me, in as much as it gives me the total I expected.

The formula is an arry formula as I said, that means it needs to be entered in a specific way - did you do that?

Paste formula in cell. Press F2 key to select formula then hold down CTRL and SHIFT keys and at the same time press ENTER. Curly braces like { and } should appear around the formula in the formula bar. If you change the formula you'll need to do that again.

I also realised that there is a shorter formula you could use, i.e.

=SUM(SUMIF(hours!A2:A25000,IF(data!H2:H5000="defense",data!B2:B5000),hours!I2:I25000))

That formula also needs to be "array entered". See attached, I've used both (on Cover sheet) for the same result. I get 79221 for your example because it sums I3 and I5 from the hours sheet - is that the result you expected?

regards, barry
test-barry.xlsx
0
 
LVL 50

Expert Comment

by:barry houdini
Comment Utility
Typo alert:

"arry formula" should, of course, be "array formula"

barry
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now