Sum Across Worksheets Using Criteria

RHK123

New Member
Joined
Nov 6, 2020
Messages
16
Office Version
  1. 365
Platform
  1. Windows
Hello Excel Experts!

I have a workbook with 50+ worksheets (the actual number of worksheets varies).
Each day new worksheets with unique names are added to the workbook, and other worksheets are deleted.
All worksheets have the same format: column "A" are dates, and column "B" are values. The dates in each worksheet can be the same or different from dates in other worksheets.

I want to add a "Totals" worksheet using the same format that sums the value for each day across all of the worksheets in the workbook.

I currently use a long formula with repeated XLOOKUP() + XLOOKUP() + XLOOKUP()...for each date in each worksheet in the workbook.
Every day I need to modify this formula by adding an XLOOKUP for the newly added worksheets and deleting XLOOKUPs for the worksheets that were removed.
Eventually, I will make a mistake due to the length of the formula containing 50+ XLOOKUPS and the daily frequency of changes.

I want to use the shorter and simpler formula like "=Sum(Sheet1:Sheet50!B2)" which would sum the value in cell B2 across worksheets 1:50, and eliminate the problem of referencing each workbook - however, since the date ranges are in Column A of each worksheet it is necessary to add date criteria to this SUM formula. How do I do this?

I've created a simplified example here for downloading:
You will need to download it as an xlsx, otherwise it will open as google sheets and the formulas will throw errors.

Hopefully, I made myself clear. If not, please let me know.

Thank you!
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Roughly how many rows of data will you have in each sheet?
 
Upvote 0
3d Sumif 2021.xlsm
ABCDEF
1DatesAmountSheetL
29-Mar-22601e
310-Mar-223001f
4Sheet1
5
Totals
Cell Formulas
RangeFormula
B2B2=SUM(SUMIF(INDIRECT("'"&SheetL&"'!"&"A2:A800"),A2,INDIRECT("'"&SheetL&"'!"&"B2:B800")))
B3B3=SUM(SUMIF(INDIRECT("'"&SheetL&"'!"&"A2:A200"),A3,INDIRECT("'"&SheetL&"'!"&"B2:B200")))
Named Ranges
NameRefers ToCells
SheetL=Totals!$F$2:$F$4B2:B3
 
Upvote 0
minor edit
3d Sumif 2021.xlsm
ABCDEF
1DatesAmountSheetL
29-Mar-22601e
310-Mar-223001f
4Sheet1
5
Totals
Cell Formulas
RangeFormula
B2:B3B2=SUM(SUMIF(INDIRECT("'"&SheetL&"'!"&"A2:A800"),A2,INDIRECT("'"&SheetL&"'!"&"B2:B800")))
Named Ranges
NameRefers ToCells
SheetL=Totals!$F$2:$F$4B2:B3
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,545
Members
449,089
Latest member
davidcom

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