How to Count Specific Values (Yes, Y, 1) in Excel
Question details
The user needs a formula to count cells in a range that contain specific affirmative values (1, y, yes) while ignoring negative or blank values, without triggering a circular reference.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Counting specific affirmative text and number responses in a dataset, such as tallying survey results.
- Observed behavior
- The user needs to output the total count of 'yes', 'y', and '1' values but encounters a circular reference if the formula is placed inside the counted range.
Ensure the cell where you type your formula is outside the data range you intend to count, as placing it inside will cause a circular reference error.
Use the SUM and COUNTIF Array Formula
Combine SUM and COUNTIF to count multiple specific criteria at once without needing nested IF/OR statements.
Instead of using a long IF and OR combination, embedding a COUNTIF function inside a SUM function using an array constant is the most efficient way to count multiple specific text strings and numbers simultaneously.
Select an empty cell strictly outside your target data range (for example, click on G18 if your data is located in G6:G17).
Type the formula =SUM(COUNTIF(G6:G17,{1,"y","yes"})) into the formula bar.
Press Enter to calculate the total count of cells matching any of the specified values.
Drag the fill handle to the right to copy or adapt the formula for adjacent columns if needed.

Count Data Easily with WPS Spreadsheet
WPS Spreadsheet fully supports advanced array formulas like SUM and COUNTIF, allowing you to quickly analyze survey results or count specific text values without compatibility issues.
- 1. Open your file in WPS Spreadsheet: Launch WPS Office and open your workbook containing the target data.
- 2. Select a result cell: Click an empty cell outside your target data range to prevent circular references.
- 3. Input the formula: Type =SUM(COUNTIF(G6:G17,{1,"y","yes"})) and press Enter to instantly see your combined count.

Frequently Asked Questions
Why am I getting a circular reference warning when counting cells?
A circular reference occurs when a formula refers to its own cell, either directly or indirectly. Always place your COUNTIF or SUM formula in a cell completely outside the range it is analyzing to avoid this error.
Can I use an IF and OR formula instead of COUNTIF?
While possible, an IF and OR array formula is much more complex and computationally heavy. Using =SUM(COUNTIF(range, {criteria1, criteria2})) is the industry-standard, efficient method for counting multiple specific values.
Are COUNTIF criteria case-sensitive in Excel?
No, the COUNTIF function is not case-sensitive. It will treat 'yes', 'Yes', and 'YES' identically when counting cell values, saving you from writing multiple case variations in your formula.




