Summing based on multiple criteria, multiple sheets

M.E. MAD

Board Regular
Joined
Nov 13, 2003
Messages
60
I am attempting to sum based on checking two different columns on each sheet within an entire workbook, but when I finish my formula all I get is 0 for an answer. Below is an example of what I'm trying to do.



=sum(if(e22:e32=0832,if(f22:f32='3p001lf',r22:r32,0)))

The above is the formula for a single sheet, but when I attempt to do the same thing for multiple sheet checking I get nothing but errors. Please Help!

Thanks,

Mike
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
M.E. MAD said:
I am attempting to sum based on checking two different columns on each sheet within an entire workbook, but when I finish my formula all I get is 0 for an answer. Below is an example of what I'm trying to do.



=sum(if(e22:e32=0832,if(f22:f32='3p001lf',r22:r32,0)))

The above is the formula for a single sheet, but when I attempt to do the same thing for multiple sheet checking I get nothing but errors. Please Help!

Thanks,


It needs to be array entered

=sum(if(e22:e32="0832",if(f22:f32="3p001lf",r22:r32,0)))


or normally entered, assuming 0832 is text, if not omit the ""

=SUMPRODUCT((E22:E32="0832")*(F22:F32="3P001LF"),R22:R32)
 
Upvote 0
Thanks for the reminder about doing it as an array. The other problem I'm having is how to write the part where I am identifying ranges from multiple sheets. Thanks, in advance.

Mike
 
Upvote 0
M.E. MAD said:
Thanks for the reminder about doing it as an array. The other problem I'm having is how to write the part where I am identifying ranges from multiple sheets. Thanks, in advance.

Mike

Mike,

It's a bit unclear what you mean by "ranges from multiple sheets". Maybe you can post the formula you attempted at or elaborate your description.
 
Upvote 0
Here is the formula I attempted to create:

{=sum(if(sheet1:sheet5!e22:e32=0832,if(sheet1:sheet5!f22:f32='3p001lf',sheet1:sheet5!g22:g32,0)))

In laymans terms, here is what I'm attemtping to do:

I have a cell where I need to check a range (e22:e32) from all sheets to see if a location code exists. If it does, I then need to check for a job order number (3p001lf) in another column. if both exist, I then need to sum all hours charged based on a third colum(g22:g32). Hopefully this is enough info to give insight on where I seem to be going wrong.

note:
I always seem to get zero. The sheet numbers are shown in place of actual sheet names. Thanks again for all the help.
 
Upvote 0
M.E. MAD said:
Here is the formula I attempted to create:

{=sum(if(sheet1:sheet5!e22:e32=0832,if(sheet1:sheet5!f22:f32='3p001lf',sheet1:sheet5!g22:g32,0)))

In laymans terms, here is what I'm attemtping to do:

I have a cell where I need to check a range (e22:e32) from all sheets to see if a location code exists. If it does, I then need to check for a job order number (3p001lf) in another column. if both exist, I then need to sum all hours charged based on a third colum(g22:g32). Hopefully this is enough info to give insight on where I seem to be going wrong.

note:
I always seem to get zero. The sheet numbers are shown in place of actual sheet names. Thanks again for all the help.

I thought that is what you were after. Consider using the morefunc add-in for the following:

=SUMPRODUCT(--(THREED(Sheet1:Sheet5!$E$2:$E$32)=A1),--(THREED(Sheet1:Sheet5!$F$2:$F$32)=B1),THREED(Sheet1:Sheet5!$G$2:$G$32))

where A1 houses a value like 0832 (a text value) and B1 3p001lf.
 
Upvote 0
Aladin,

You are a savior. I did exactly as you posted and was able to get working formulas into my spreadsheet. Thanks!

Mike

p.s. what do the -- symbolize in the formula
=SUMPRODUCT(--(THREED('0105:0628'!$F$22:$F$32)=X22),--(THREED('0105:0628'!$J$22:$J$32)=Z22),THREED('0105:0628'!$N$22:$N$32))
 
Upvote 0
M.E. MAD said:
Aladin,

You are a savior. I did exactly as you posted and was able to get working formulas into my spreadsheet. Thanks!

Mike

p.s. what do the -- symbolize in the formula
=SUMPRODUCT(--(THREED('0105:0628'!$F$22:$F$32)=X22),--(THREED('0105:0628'!$J$22:$J$32)=Z22),THREED('0105:0628'!$N$22:$N$32))

It coerces logical values into numbers, that is,...

=--TRUE ===> 1

=--FALSE ===> 0

Conditional expressions within SumProduct all evaluate to arrays of logical values (like in {TRUE,FALSE,TRUE,...}, the -- bit makes them numbers (like in {1,0,0,...}, precisely the way SumProduct needs them.
 
Upvote 0
Re: Summing based on multiple criteria, multiple WORKBOOKS

Aladin,

Now that I've been able to get the formula to work for multiple sheets in
one workbook, i would like to be able to also do the same thing utilizing several workbooks. Is this possible? Please help...again!

Thanks,

Mike
 
Upvote 0

Forum statistics

Threads
1,215,460
Messages
6,124,949
Members
449,198
Latest member
MhammadishaqKhan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top