Sum across multiple tabs, criteria on each tab

Sharon in Denver

Board Regular
Joined
Oct 24, 2007
Messages
54
I have over a hundred tabs that are identical in format and data type. Each tab belongs to one of two categories, A or B. On a summary tab with the same formats all the others, I have in corresponding cells the formula =Sum('first:Last'I4) for many columns and many rows. What I'd like to do is create two more summary tabs (A and B) and be able to perform that same Sum, but based on the criteria on each tab in H1. I've researched Sumproduct(sumif and I don't think that is what I need, since my criteria is on the individal tabs, not a separate, summary tab. But I'm not sure.

I would prefer to do this with a formula, if at all possible.

Thanks in advance!
 
Here's what I have, and I'm getting an error. Can you see what I've done wrong?

=SUMPRODUCT(SUMIF(INDIRECT("'"&CPool&"'!H1"),C,INDIRECT("'"&CPool&"'!I4")))

I've named the range with my two lists BPool and CPool. They refer to the tabs with the list of all the wells in each pool.
 
Upvote 0

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Here's what I have, and I'm getting an error. Can you see what I've done wrong?

=SUMPRODUCT(SUMIF(INDIRECT("'"&CPool&"'!H1"),C,INDIRECT("'"&CPool&"'!I4")))

I've named the range with my two lists BPool and CPool. They refer to the tabs with the list of all the wells in each pool.
What is "C" supposed to be? Is it supposed to be a cell reference like maybe C1?
 
Upvote 0
Let's assume the sheet names are in the range A1:A100

B1 = A or B

=SUMPRODUCT(SUMIF(INDIRECT("'"&A1:A100&"'!H1"),B1,INDIRECT("'"&A1:A100&"'!I4")))

<<<<<<<<<<<<<<<<<I don't know how to insert that as quoted text>>>>>>>>>>>>>>>>

The 'C' is the value in H1 that differentiates the B-Pool from the C-Pool. So, I have two tabs with a list of each pool. In the cell H1 I have B on the tab that has the B-Pool list and C on the tab that has the C-Pool list.
 
Upvote 0
Let's assume the sheet names are in the range A1:A100

B1 = A or B

=SUMPRODUCT(SUMIF(INDIRECT("'"&A1:A100&"'!H1"),B1,INDIRECT("'"&A1:A100&"'!I4")))

<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>

The 'C' is the value in H1 that differentiates the B-Pool from the C-Pool. So, I have two tabs with a list of each pool. In the cell H1 I have B on the tab that has the B-Pool list and C on the tab that has the C-Pool list.

If "C" is the criteria then it needs to be quoted if you're hardcoding it directly into the formula:

=SUMPRODUCT(SUMIF(INDIRECT("'"&CPool&"'!H1"),"C",INDIRECT("'"&CPool&"'!I4")))
 
Upvote 0
That's exactly what I have. I was trying to quote your previous message, but I don't know how to do that, and the <<<'s took out my note to that effect.

This is what I have:

=SUMPRODUCT(SUMIF(INDIRECT("'"&CPool&"'!H1"),C,INDIRECT("'"&CPool&"'!I4")))
 
Upvote 0
OOPS!!! I just noticed the quotes around the C!! But that give me me a #REF! error. Here's what I have now:

=SUMPRODUCT(SUMIF(INDIRECT("'"&CPool&"'!H1"),"C",INDIRECT("'"&CPool&"'!I4")))
 
Upvote 0
OOPS!!! I just noticed the quotes around the C!! But that give me me a #REF! error. Here's what I have now:

=SUMPRODUCT(SUMIF(INDIRECT("'"&CPool&"'!H1"),"C",INDIRECT("'"&CPool&"'!I4")))
I'll be away for a few hours.

I'll put together a sample file when I get back.
 
Upvote 0
Note:

All the sheetnames in CPool must exactly match the actual sheetnames in your workbooks.
 
Upvote 0
NVBC, the sheet names match exactly. I have a macro that creates a list of all the sheet names, and I just parsed out the B-Pool and C-Pool.

Biff, I am leaving at noon, so we may have to tackle this next week! Have a great weekend!
 
Upvote 0
I did a quick test and it worked fine for me with your exact formula, using a couple of sheets in CPool...

You don't have any blank cells in the CPool range, do you?
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,834
Members
452,947
Latest member
Gerry_F

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