Sum data from multiple sheets for multiple criteria

Frank J

Board Regular
Joined
Feb 17, 2011
Messages
104
Office Version
  1. 365
Platform
  1. Windows
I have a Summation sheet that needs to collect and total data for staff across 26 other sheets. They are all formatted the same and the data needed sits in the same column on all 26. I'm using their Employee ID # as a reference point since it's unique to each employee. I've tried but failed with Index/Match and am not sure how to use Indirect to help pull the data together

The 26 sheets have the data in data Tables uniquely named.

I'm using Excel 2016

1616193406947.png
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
You will need a list of the sheet names to refer to, then you can do it with a formula like
Excel Formula:
=SUM(SUMIFS(INDIRECT("'"&sheetlist&"'!Q2:Q3"),INDIRECT("'"&sheetlist&"'!A2:A3"),$A8))
Which must be array confirmed with Ctrl Shift Enter.

It might be possible to use table names instead of sheet names and normal ranges, this is not something that I've tried to do.
 
Upvote 0
Solution
SumProduct should also work; it does not require Array Enter (CSE).

=SUMPRODUCT(SUMIFS(INDIRECT("'"&Sheetlist&"'!$Q$2:$Q$100"),INDIRECT("'"&Sheetlist&"'!$A$2:$A$100"),$A8))
 
Upvote 0
SumProduct should also work; it does not require Array Enter (CSE).

=SUMPRODUCT(SUMIFS(INDIRECT("'"&Sheetlist&"'!$Q$2:$Q$100"),INDIRECT("'"&Sheetlist&"'!$A$2:$A$100"),$A8))
Thx, I'll find a use for this as well I'm sure.
 
Upvote 0
SumProduct should also work; it does not require Array Enter (CSE).

=SUMPRODUCT(SUMIFS(INDIRECT("'"&Sheetlist&"'!$Q$2:$Q$100"),INDIRECT("'"&Sheetlist&"'!$A$2:$A$100"),$A8))
You helped greatly with the formula and it works in the book i first used it but now it's not working for a similar workbook and I can't understand why. All tabs are formatted the same as the one I'm showing. I'm trying to get the YTD roll up to look at each Monthly sheet and sum each Table ID up for the year.

YTD Sheet
Month TabsTotals:#REF!#REF!#REF!#REF!
Dec 2020Table ID# of TransVoucher AmountFee AmountTotal Amount
Jan 2021Table: 01-BP106=SUMPRODUCT(SUMIFS(INDIRECT("'"&MonthTabs&"'!$B3:$B50"),INDIRECT("'"&MonthTabs&"'!$A3:$A50"),$B3))
#REF!​
#REF!​
#REF!
Feb 2021Table: 01-CC101
Mar 2021Table: 01-CR108
Apr 2021Table: 01-DD102
May 2021Table: 01-RT103
Jun 2021Table: 01-RW105
Jul 2021Table: 01-SD102
Aug 2021Table: 02-BP205
Sep 2021Table: 02-BP206
Oct 2021Table: 02-BP207
Nov 2021Table: 02-DD202
Dec 2021Table: 02-JP203

Monthly Sheet
Totals:388$119,372.00$3,447.44$122,819.44
Table ID# of TransVoucher AmountFee AmountTotal Amount
Table: 01-BP10615$8,370.00$203.40$8,573.40
Table: 01-CC10123$4,924.00$178.48$5,102.48
Table: 01-CR1084$520.00$26.40$546.40
Table: 01-DD10221$10,250.00$257.00$10,507.00
Table: 01-RT10335$5,470.00$193.40$5,663.40
Table: 01-RW10534$4,390.00$143.80$4,533.80
Table: 02-BP20519$3,280.00$113.60$3,393.60
Table: 02-BP20641$8,520.00$286.40$8,806.40
Table: 02-BP20738$6,128.00$238.56$6,366.56
 
Upvote 0
Can you post an extract of your data with the forum's tool XL2BB?
What is your expected result.
N.B. We cannot see your spreadsheet and we do not know what you are trying to do.

Check that the name of the relevant sheet(s) are in the named range MonthTabs.
Check that reference is B3 is correct.
 
Upvote 0
I can't use the tool because I'm on a work computer and it won't let me download it, I've tried.

In the example sheet for the Month I've got it as a table and it's data from a month of business. I'd like to total each month's # of trans for each Table ID, the amount of vouchers, the Fees and then the totals for the Vouchers plus the Fees in the YTD sheet.

The YTD sheet layout is the named range MonthTabs in Column A and the rest follow out.
On the Month sheets the Table ID column is A and they move out to B, C, D and E.
They start on row 2, row 1 is just totaling the individual columns and not to be included in the formula.

The formula >>> SUMPRODUCT(SUMIFS(INDIRECT("'"&MonthTabs&"'!$B3:$B50"),INDIRECT("'"&MonthTabs&"'!$A3:$A50"),$B3)) In this formula $B3 is referring to the Table ID on the YTD sheet, this is the unique identifier that I'll use to match up the data across the worksheets for each month. So I have that pointing at the column on each Month sheet to match up those Table IDs and return the appropriate data from the column I reference first, have I done that right?

$A$3:$A50 is the range of Table IDs on every sheet for each Month,
$B$3:$B$50 is the range of # of Trans on every sheet for each Month,
$C$3:$C$50 is the range of Voucher Amounts on every sheet for each Month,
$D$3:$D$50 is the range of Fee Amount on every sheet for each Month
The Total Amount is just a Sum of Voucher and Fee amounts.

My apologies for not being able to give you an actual worksheet.
 
Upvote 0
If you want to secure the total from each sheet individually, you
can use indirect as illustrated below.

Source sheet
SumProduct 2020.xlsm
AB
1
2Totals388
Dec2020


Summary Sheet
SumProduct 2020.xlsm
AB
1
2Dec2020388
5a
Cell Formulas
RangeFormula
B2B2=INDIRECT("'"&A2&"'!"&"B2")
 
Upvote 0
I need it to total all the monthly sheets, how will that do it? Seems to be pulling only an individual month
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

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