Solved

Another Excel ? Multi Worksheets

Posted on 2011-02-24
8
172 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

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!

Question has a verified solution.

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

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…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
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 how to use a scrolling table in Microsoft Excel using the INDEX function.

740 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