How to Count Y and N Values Across Multiple Excel Worksheets
Question details
The user needs to count specific data-validation entries (exactly "Y" or "N") across multiple worksheet tabs from a central summary worksheet.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Compiling a summary report that totals specific responses from identical data ranges spread across several different worksheet tabs.
- Observed behavior
- The standard COUNTIF function does not natively support 3D references across multiple worksheets without combining it with other functions like SUMPRODUCT and INDIRECT.
Ensure all the target worksheets share the exact same layout for the data range, and verify that the cells contain exactly "Y" or "N" without any hidden trailing spaces.
Use SUMPRODUCT, COUNTIF, and INDIRECT Functions
This is the most efficient formula-based method to count specific values across multiple tabs by referencing a predefined list of sheet names.
By creating a named range that lists all your sheet names, you can use the INDIRECT function to pass this array of sheets to the COUNTIF function. The SUMPRODUCT function then calculates the total count across all referenced sheets.
On your summary worksheet, type the exact names of all the worksheet tabs you want to include in the count in a single column.
Highlight the list of sheet names you just created. Click inside the Name Box (located to the left of the formula bar), type "SheetList", and press Enter.
Select the cell where you want the total count for "Y" to appear. Enter the formula: =SUMPRODUCT(COUNTIF(INDIRECT("'"&SheetList&"'!A1:A10"),"Y")). Be sure to replace A1:A10 with the actual range containing your data.
To count the "N" values, copy the formula to another cell and change the criteria from "Y" to "N" like this: =SUMPRODUCT(COUNTIF(INDIRECT("'"&SheetList&"'!A1:A10"),"N")).

Consolidate Data Using Power Query
Best for large workbooks or when sheet names frequently change, allowing you to combine all data into one master table for simplified counting.
Count Values Across Multiple Sheets Seamlessly in WPS Spreadsheet
WPS Spreadsheet fully supports advanced array formulas, including the SUMPRODUCT, INDIRECT, and COUNTIF combination, allowing you to execute complex cross-sheet calculations flawlessly. With an intuitive interface, you can build powerful data summaries just as you would in Microsoft Excel.
- 1. Open your workbook: Launch WPS Office and open your spreadsheet file containing the multiple tabs you need to analyze.
- 2. Define your sheet list: Type your sheet names in a column, highlight them, and define the range as "SheetList" using the Name Box.
- 3. Apply the array formula: Enter =SUMPRODUCT(COUNTIF(INDIRECT("'"&SheetList&"'!A1:A10"),"Y")) to instantly calculate your total counts across all designated sheets.

Frequently Asked Questions
Why is my cross-sheet counting formula returning a #REF! error?
A #REF! error typically occurs if a worksheet name listed in your "SheetList" named range is misspelled, contains extra spaces, or if the sheet has been deleted. Double-check that the names in your list match the actual worksheet tabs exactly.
Does data validation affect how the COUNTIF formula works?
No, data validation only restricts what a user can input into a cell via drop-down lists or rules. COUNTIF evaluates the final text value stored in the cell. As long as the cell text matches your formula criteria (e.g., exactly "Y"), it will be counted.
Can I use 3D references with COUNTIF natively instead of this complex formula?
Unfortunately, standard spreadsheet software does not support 3D references (such as Sheet1:Sheet5!A1:A10) inside a standard COUNTIF or COUNTIFS function. Using SUMPRODUCT combined with COUNTIF and INDIRECT is the standard and most reliable workaround.
How do I count based on multiple criteria across multiple sheets?
To evaluate multiple conditions, replace the COUNTIF function with COUNTIFS inside your SUMPRODUCT and INDIRECT formula structure. You can then add the additional criteria ranges and arguments required for your specific conditions.




