logo
search
Function Problems

How to Count Unique Students Once with Multiple Criteria in Excel

Amos GikundaAmos Gikunda Sep 28, 2026 868 views

Question details

The user needs to count unique students matching specific criteria without double-counting individuals who appear in multiple rows.

How to Count Each Unique Student Once in Excel
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.
Before you start

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.

Solution 1Recommended

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.

1
Select the result cell

Click on the cell where you want the final unique count to appear.

2
Enter the FILTER function

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

3
Wrap with UNIQUE

Enclose the FILTER function within the UNIQUE function to remove any duplicate student records: UNIQUE(FILTER(...))

4
Count the rows

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

5
Execute the formula

Press Enter to calculate and display the distinct count of students.

Use the UNIQUE and FILTER Functions (Microsoft 365)
Adjusting Column Names: Make sure to replace 'ES_2[Student]', 'ES_2[SPECIAL_ED]', and 'ES_2[Included Exp/Sus]' with the actual table and column names used in your worksheet.
Use WPS Office for Advanced Data Analysis

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. 1. Open your dataset: Launch WPS Spreadsheet and open your .xlsx or .xls data file.
  2. 2. Select the target cell: Click on the destination cell for your unique count result.
  3. 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. 4. Calculate the result: Press Enter to instantly view the deduplicated count based on your specific criteria.
Fully compatible with Microsoft Excel formulas and file formats (.xlsx).Supports dynamic array functions like UNIQUE and FILTER for modern data analysis.Lightweight, fast, and free to use for everyday office tasks.Built-in templates and an intuitive user interface for easier data management.
microsoft office alternative - wps office

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.