How to Count Unique Students Once with Multiple Criteria in Excel
Question details
The user needs to count unique students matching specific criteria without double-counting individuals who appear in multiple rows.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Analyzing student data where individual students have multiple records, but the final report requires counting each qualifying student only once.
- Observed behavior
- Standard COUNTIFS functions count every qualifying row, resulting in inflated numbers when a single student has multiple rows meeting the criteria.
Ensure your data range is formatted as a Table for easier formula referencing, and check if your version of Excel supports Dynamic Arrays like UNIQUE and FILTER.
Use the UNIQUE and FILTER Functions (Microsoft 365)
This is the most efficient and recommended way to count distinct items with multiple criteria in modern Excel versions.
By combining the UNIQUE, FILTER, and ROWS functions, you can extract a list of unique names that meet your criteria and immediately count them without modifying your original dataset.
Click on the cell where you want the final unique count to appear.
Type the FILTER formula to narrow down the data based on your specific conditions. For example: FILTER(ES_2[Student],(ES_2[SPECIAL_ED]="Y")*(ES_2[Included Exp/Sus]=1))
Enclose the FILTER function within the UNIQUE function to remove any duplicate student records: UNIQUE(FILTER(...))
Wrap the entire formula in the ROWS function to count the remaining distinct results: =ROWS(UNIQUE(FILTER(ES_2[Student],(ES_2[SPECIAL_ED]="Y")*(ES_2[Included Exp/Sus]=1))))
Press Enter to calculate and display the distinct count of students.

Create a Helper Column (For Older Excel Versions)
If your Excel version does not support dynamic array functions, you can flag the first occurrence of each qualifying student and sum the flags.
Easily Count Unique Records with WPS Spreadsheet
WPS Office offers robust spreadsheet capabilities, including advanced formulas and dynamic array functions that allow you to seamlessly count unique values with multiple criteria without complex workarounds.
- 1. Open your dataset: Launch WPS Spreadsheet and open your .xlsx or .xls data file.
- 2. Select the target cell: Click on the destination cell for your unique count result.
- 3. Apply the dynamic formula: Enter the formula =ROWS(UNIQUE(FILTER(Data[Student], (Data[Condition1]="Y")*(Data[Condition2]=1)))) replacing table names with your own.
- 4. Calculate the result: Press Enter to instantly view the deduplicated count based on your specific criteria.

Frequently Asked Questions
Why does COUNTIFS return duplicate counts for the same student?
The COUNTIFS function simply counts every single row that matches your criteria. If a student's name appears on five different rows that all meet the criteria, COUNTIFS will count it as five instead of one unique student.
What should I do if the FILTER function returns a #CALC! error?
The #CALC! error occurs when the FILTER function finds no rows that meet your criteria. You can fix this by using the optional [if_empty] argument in the FILTER function, or by wrapping your entire formula in IFERROR(..., 0) to return 0 instead of an error.
Can I count unique values with a PivotTable instead of formulas?
Yes. When creating a PivotTable, check the box that says 'Add this data to the Data Model'. This unlocks the 'Distinct Count' aggregation option in the Value Field Settings, allowing you to count unique students without writing complex formulas.




