Function Problems

How to Count Items Across Multiple Excel Worksheets Automatically

Natalie TaylorNatalie Taylor Nov 11, 2026 869 views

Question details

The user wants to track and count the occurrences of a specific item (such as a replacement part) across multiple worksheets and have the total count update automatically.

How to Count Items Across Multiple Excel Worksheets Automatically
Product
Excel
Device & OS
not provided
Scenario
Tracking inventory or parts spread across different machine or departmental worksheets without manually opening and checking each sheet.
Observed behavior
Needing a dynamic formula approach to aggregate item counts across a large number of sheets (e.g., 20 machine sheets) into a single summary sheet.
Before you start

Ensure all your target worksheets have a consistent structure, meaning the items you want to count should be located in the exact same column or range across every sheet.

Solution 1Recommended

Use SUMPRODUCT and INDIRECT to Count Across Sheets

Combine the SUMPRODUCT, COUNTIF, and INDIRECT functions to dynamically calculate the total occurrences of an item from a defined list of worksheet names.

Since the COUNTIF function does not support 3D referencing (e.g., Sheet1:Sheet20), you can bypass this limitation by creating a list of your sheet names and using INDIRECT to reference them dynamically.

1
List Worksheet Names

On a summary sheet, create a vertical list containing the names of all the target machine worksheets exactly as they appear on the sheet tabs.

2
Create a Named Range

Select the list of sheet names, click the Name Box (located to the left of the formula bar), type 'Sheets', and press Enter. This creates a named range called Sheets.

3
Enter the Search Item

Type the specific item name you want to count (such as 'belt 1595x5Mx25') into cell A2 of your summary sheet.

4
Apply the Formula

In cell B2, enter the formula: =SUMPRODUCT(COUNTIF(INDIRECT("'"&Sheets&"'!D2:D100"),A2)). Make sure to replace D2:D100 with the actual range where the items are stored on each individual machine sheet.

Use SUMPRODUCT and INDIRECT to Count Across Sheets
Formula Explanation: INDIRECT dynamically references the sheet names from your named range, COUNTIF counts the item on each respective sheet, and SUMPRODUCT adds all the resulting counts together into one total.
Work efficiently with WPS Spreadsheet

Count Across Multiple Sheets Seamlessly in WPS Office

WPS Spreadsheet fully supports advanced array formulas like SUMPRODUCT and INDIRECT, allowing you to easily manage complex multi-sheet calculations just like in Excel. It provides a familiar, fast, and completely free environment to handle heavy data tasks.

  1. 1. Open your Workbook: Launch WPS Spreadsheet and open the workbook containing your multi-sheet data.
  2. 2. Define the Named Range: List your target sheet names, select them, and use the Name Box to define them as 'Sheets'.
  3. 3. Insert the Formula: Use the standard =SUMPRODUCT(COUNTIF(INDIRECT...)) formula to instantly aggregate your item counts across the sheets.
100% compatible with Microsoft Excel formulas, functions, and file formatsLightweight design ensures smooth performance even with multi-sheet data processingFree built-in data analysis tools, pivot tables, and advanced formatting
microsoft office alternative - wps office

Frequently Asked Questions

Why is my INDIRECT formula returning a #REF! error?

A #REF! error usually occurs if the sheet names in your named range list contain typos, have extra spaces, or do not exactly match the actual sheet tabs. It can also happen if one of the referenced sheets was deleted or renamed.

Can I use 3D references like COUNTIF(Sheet1:Sheet20!D2:D100, A2)?

No, the COUNTIF and COUNTIFS functions do not support 3D references across multiple sheets. You must use the SUMPRODUCT and INDIRECT combination or consolidate your data into a single sheet first.

Will the INDIRECT formula update if I add a new worksheet?

Not automatically. If you add a new worksheet, you must manually add the new sheet's name to your summary list and ensure your 'Sheets' named range expands to include the new cell. Once updated, the formula will include the new sheet in its count.

Does this formula work if my sheet names contain spaces?

Yes, it works perfectly because the formula includes single quotes around the sheet name reference ("'"&Sheets&"'"). This ensures that any sheet name containing spaces or special characters is parsed correctly by the INDIRECT function.