Function Problems

How to Count Y and N Values Across Multiple Excel Worksheets

Aamir Naveed AkramAamir Naveed Akram Nov 10, 2026 869 views

Question details

The user needs to count specific data-validation entries (exactly "Y" or "N") across multiple worksheet tabs from a central summary worksheet.

How to Count Y and N Values Across Multiple Excel Worksheets
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.
Before you start

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.

Solution 1Recommended

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.

1
Create a list of sheet names

On your summary worksheet, type the exact names of all the worksheet tabs you want to include in the count in a single column.

2
Name the cell range

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.

3
Enter the counting formula

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.

4
Count other values

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")).

Use SUMPRODUCT, COUNTIF, and INDIRECT Functions
Formatting Tip: The single quotation marks inside the INDIRECT function ensure the formula works perfectly even if your sheet names contain spaces.
Advanced Spreadsheet Tools

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. 1. Open your workbook: Launch WPS Office and open your spreadsheet file containing the multiple tabs you need to analyze.
  2. 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. 3. Apply the array formula: Enter =SUMPRODUCT(COUNTIF(INDIRECT("'"&SheetList&"'!A1:A10"),"Y")) to instantly calculate your total counts across all designated sheets.
Full support for SUMPRODUCT, COUNTIF, and INDIRECT cross-sheet formulas.100% format compatibility with Microsoft Excel (.xlsx and .xls) files.Free, lightweight alternative with fast installation and robust performance.Built-in advanced data validation and formula auditing tools.
microsoft office alternative - wps office

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.