Solved

Another Excel ? Multi Worksheets

Posted on 2011-02-24
8
173 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
8 Comments
 
LVL 33

Expert Comment

by:jppinto
ID: 34973080
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
ID: 34973085
If you need aditional help, you could post a sample sheet for us to take a look.

jppinto
0
 

Author Comment

by:Matt Pinkston
ID: 34975132
here is a sample file test.xlsx
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 50

Expert Comment

by:barry houdini
ID: 34975170
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
 
LVL 50

Expert Comment

by:barry houdini
ID: 34975227
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
ID: 34976263
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
ID: 34978431
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
ID: 34978468
Typo alert:

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

barry
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

696 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