Use COUNTIFS to Return Yes or No by Group in WPS Spreadsheets
Question details
Return a Yes or No result for each identifier based on the statuses of all its records.

- Product
- WPS Spreadsheets
- Device & OS
- not provided
- Scenario
- An identifier can appear in multiple rows, each with a Yes or No status.
- Observed behavior
- The desired result is Yes only if every matching record is Yes; a single No should produce No.
Place identifiers in one column and their statuses in another. In the examples below, identifiers are in A2:A12, statuses are in B2:B12, and D2 contains the identifier to check.
Check That Every Matching Status Is Yes
Use this formula to return No for any matching status that is not Yes and a blank when the identifier is not found.
In cell D2, enter an identifier that appears in A2:A12.
In cell E2, enter =IF(COUNTIF($A$2:$A$12,D2)=0,"",IF(COUNTIFS($A$2:$A$12,D2,$B$2:$B$12,"Yes")=COUNTIF($A$2:$A$12,D2),"Yes","No")) and press Enter.
Enter additional identifiers below D2, then drag the fill handle from E2 down to calculate their results. Adjust both data ranges to cover your records.

Return No When Any Matching Status Is No
Use this shorter formula when every matching status is guaranteed to be either Yes or No.
Calculate Group Statuses in WPS Spreadsheets
Use COUNTIF and COUNTIFS in WPS Spreadsheets to check every status for an identifier and return a group-level Yes or No.
- 1. Open your worksheet: Open WPS Spreadsheets and select File > Open to choose your workbook.
- 2. Arrange the data: Place identifiers in A2:A12, statuses in B2:B12, and the identifier to check in D2.
- 3. Calculate the result: Select E2, enter =IF(COUNTIF($A$2:$A$12,D2)=0,"",IF(COUNTIFS($A$2:$A$12,D2,$B$2:$B$12,"Yes")=COUNTIF($A$2:$A$12,D2),"Yes","No")), and press Enter.
- 4. Fill down: Add more identifiers below D2 and drag the fill handle from E2 down to calculate each result.

Frequently Asked Questions
Why does the shorter formula return Yes for an identifier that is not listed?
COUNTIFS finds zero matching No values when the identifier is absent, so the formula returns Yes. Use the formula with COUNTIF in the recommended solution to return a blank when there are no matching rows.
What happens if a matching status cell is blank?
The recommended formula returns No because the blank cell is not Yes. The shorter formula only looks for No, so it may return Yes despite the blank.
How do I use the formula for more than one identifier?
List the identifiers in column D, enter the formula in E2, and drag E2's fill handle down. The D2 reference changes for each row, while the ranges marked with dollar signs stay fixed.
Can I use these formulas in Microsoft Excel?
Yes. Microsoft Excel supports IF, COUNTIF, and COUNTIFS. Enter the same formula in a worksheet cell and adjust the ranges to match your data.




