How to Use COUNTIF Across Multiple Excel Sheets
Question details
The user needs to count occurrences of specific text, such as employee names, across multiple daily worksheets where the names appear in different positions but within the same range.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Tracking and tallying employee names or text occurrences across daily or weekly sheets in a single workbook.
- Observed behavior
- Requires a formula that can dynamically aggregate and count values spanning a 3D range across multiple worksheet tabs.
Ensure all the worksheets you want to include in the calculation are grouped together consecutively in your workbook to use a 3D reference effectively.
Use Advanced Array Functions (LET, TOCOL, GROUPBY) in Excel 365
Combine the daily ranges into a single array and count the occurrences of each name seamlessly using modern Excel functions.
If you are using a recent version of Excel, you can utilize modern array functions to stack data from multiple sheets into a single column and automatically group and count them.
Click on the cell in your master summary sheet where you want to display the final counts.
Type the formula: `=LET(x,TOCOL(Sheet2:Sheet4!A2:A100,1),GROUPBY(x,x,COUNTA,,0))`
Replace 'Sheet2:Sheet4' with the actual names of your starting and ending sheets, and adjust 'A2:A100' to match your data range.
Press Enter to generate a stacked list of unique names alongside their respective occurrence counts.

Use SUMPRODUCT and INDIRECT for Standard COUNTIF
A classic method that works in all versions of Excel and WPS Spreadsheet by listing sheet names and wrapping COUNTIF inside SUMPRODUCT.
Easily Manage and Count Across Sheets in WPS Spreadsheet
WPS Spreadsheet fully supports advanced array functions and multi-sheet references. You can quickly aggregate data across daily worksheets with familiar Excel-like formulas without compatibility issues.
- 1. Open Your Workbook: Launch WPS Spreadsheet and open the workbook containing your daily records.
- 2. Select Output Cell: Click on the cell in your master tab where you want the consolidated counts to appear.
- 3. Input Multi-Sheet Formula: Use the compatible formula `=SUMPRODUCT(COUNTIF(INDIRECT("'"&SheetList&"'!Range"), Criteria))` to target your sheets.
- 4. Calculate Data: Press Enter to instantly view your aggregated data calculated across all tabs.

Frequently Asked Questions
Can I use COUNTIF directly with a 3D reference like Sheet1:Sheet3!A1:A10?
No, the standard COUNTIF function does not natively support 3D references across multiple sheets. You must use array formulas combining functions like SUMPRODUCT and INDIRECT, or utilize newer functions like TOCOL and GROUPBY to aggregate data across sheets.
What does the TOCOL function do in the recommended Excel 365 formula?
The TOCOL function transforms a specified array or multi-sheet range into a single continuous column. By using `TOCOL(Sheet2:Sheet4!A2:A100, 1)`, the formula extracts all data across those sheets into one column while ignoring empty cells (triggered by the '1' argument).
Why is my INDIRECT formula returning a #REF! error when counting multiple sheets?
This error usually occurs if the sheet names in your reference list contain spaces or special characters but aren't properly wrapped in single quotes within the formula. Ensure your formula syntax correctly includes quotes, such as `INDIRECT("'"&CellRef&"'!Range")`.




