Forum Discussion
Formula for adding multiple sheets
m_tarler’s advice is excellent. If you have control over how your workbook is set up, combining all your transactions into one sheet (with an extra column for something like “Sheet origin” or “Month”) is absolutely the cleanest and most reliable approach. Then you can just use a PivotTable or SUMIFS to sum by name of place.
However, if you cannot change the multi-sheet structure (for example, if each sheet is generated separately and you must keep them apart), here’s an alternative step-by-step formula that builds on m_tarler’s VSTACK idea but is broken out for clarity:
=LET(
AllData, VSTACK(Sheet1:Sheet5!A2:H1000),
Names, CHOOSECOLS(AllData, 3),
Withdrawals, CHOOSECOLS(AllData, 5),
GROUPBY(Names, Withdrawals, SUM, 0, 0))
- Replace Sheet1:Sheet5 with your actual sheet names (e.g., Sheet1:Sheet10).
- Adjust A2:H1000 to cover all your data rows on each sheet.
- The GROUPBY function (available in Excel for Microsoft 365) will automatically list each unique name in column C and sum the withdrawal amounts from column E.
If you don’t have GROUPBY or VSTACK (older Excel versions), you can use a traditional approach:
- Create a list of all unique names from all sheets using UNIQUE(VSTACK(...)).
- Then use SUMIF across sheets, like:
=SUMIF(Sheet1!C:C, A2, Sheet1!E:E) + SUMIF(Sheet2!C:C, A2, Sheet2!E:E) + ...
(This becomes tedious with many sheets, so the VSTACK method is far better.)
Finally, when adding text in formulas, make sure names match exactly (e.g., “Joe Doe” vs “Joe Doe” with extra spaces). Using TRIM around names can help avoid mismatches.
My answers are voluntary and without guarantee!
Hope this will help you too.