SumProduct for multiple criteria across multiple tabs

zizzabell

New Member
Joined
Feb 2, 2011
Messages
15
I have a spreadsheet that has many tabs, each for a day's worth of work. I am trying to work on a formula that would sum together all days but only at specific farms and in specific blocks within the farms. The dates are 10-22 thru 12-20 (corresponding with the tab names) and the Farm name is in cells B6 thru Q6 on each tab (there could be work at multiple farms each day) and the block #'s are in cells B7 thru Q7 (again there could be work at multiple blocks, either in different or the same farms). The quantities that I want to sum are in cells B9 thru Q20 on each tab. The farm I want it to reference is in A1 and the block I want it to reference is in B19.

I have in the past used the following formula within a single tab and it worked great. I thought it would work across the different tabs like you would with a simple sum function, but apparently not. Can anyone help me tweak it? I am currently getting a result of #VALUE!.

{=SUMPRODUCT(--('10-22'!B6:'12-20'!Q6=A1),--('10-22'!B7:'12-20'!Q7=B19),('10-22'!B9:'12-20'!Q20))}

On another tab, I summed the amounts (using a single criteria of which farm) using Sumif and referencing each tab individually and adding them all together. It's a long, messy formula, but it got the job done. Now I need the same done including the farm AND the block numbers and if I can avoid adding ~60 sumproduct formulas together, that would be great!
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Probably best to have a formula for each worksheet, and then sum the results from those sheets. Otherwise, list the sheet names in a vertical range of cells, let's say T2:T60, then try the following formula that needs to be confirmed with CONTROL+SHIFT+ENTER...

=SUM(IFERROR(SUMIF(OFFSET(INDIRECT("'"&$T$2:$T$60&"'!B9:Q20"),,IF(T(OFFSET(INDIRECT("'"&$T$2:$T$60&"'!B6:Q6"),,COLUMN(INDIRECT("B6:Q6"))-COLUMN(INDIRECT("B6")),,1))=A1,IF(T(OFFSET(INDIRECT("'"&$T$2:$T$60&"'!B7:Q7"),,COLUMN(INDIRECT("B7:Q7"))-COLUMN(INDIRECT("B7")),,1))=B19,COLUMN(INDIRECT("B9:Q20"))-COLUMN(INDIRECT("B9")),""),""),,1),"<>"),0))

Hope this helps!
 
Last edited:
Upvote 0
Actually, I just realized we're dealing with "block numbers", which I'm assuming are numerical values not text values. If so, the second "T" function needs to be changed to "N"...

=SUM(IFERROR(SUMIF(OFFSET(INDIRECT("'"&$T$2:$T$60&"'!B9:Q20"),,IF(T(OFFSET(INDIRECT("'"&$T$2:$T$60&"'!B6:Q6"),,COLUMN(INDIRECT("B6:Q6"))-COLUMN(INDIRECT("B6")),,1))=A1,IF(N(OFFSET(INDIRECT("'"&$T$2:$T$60&"'!B7:Q7"),,COLUMN(INDIRECT("B7:Q7"))-COLUMN(INDIRECT("B7")),,1))=B19,COLUMN(INDIRECT("B9:Q20"))-COLUMN(INDIRECT("B9")),""),""),,1),"<>"),0))

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,742
Members
448,989
Latest member
mariah3

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