Counting Unique Values in Excel with Specific Criteria
In the vast realm of data analysis, Excel remains a powerful and widely-used tool. One common task is counting unique values, but what if you want to count unique values based on specific criteria? Here's a step-by-step guide to help you achieve this.
Understanding the Problem
Let's say you have a dataset like this:
| Region | Salesperson | Sales |
|---|---|---|
| East | John | 1000 |
| East | Jane | 1500 |
| West | John | 2000 |
| West | Jane | 2500 |
You want to find out how many unique salespeople there are in each region, but only if their sales are above 1500.

Using COUNTIFS with Distinct Count
Excel's COUNTIFS function is a versatile tool for counting cells that meet multiple criteria. However, it doesn't inherently count unique values. To get around this, we can use a trick with the IF function and COUNTIF.
Step 1: Create a Helper Column
In a new column, use the IF function to mark cells that meet your criteria. In our case, that's sales above 1500:
=IF(B2>1500, "Yes", "No")

Step 2: Count Unique "Yes" Values
Now, use COUNTIF to count the number of "Yes" values in each region. Wrap this in an IFERROR function to display 0 if there are no matches:
=IFERROR(COUNTIF($C$2:$C$6, "Yes"), 0)
Automating the Process
While the above method works, it's not very efficient if you have a large dataset. A more automated approach involves using a PivotTable.

Using PivotTables for Unique Counts
PivotTables are a powerful way to summarize and analyze data. Here's how to use one to count unique values with criteria:
Step 1: Insert a PivotTable
Select your data and go to Insert > PivotTable. Choose where you want to place it.
Step 2: Add Rows and Values
Drag Region to Rows and Salesperson to Values. Right-click on Salesperson and select Value Field Settings. Choose Distinct Count and click OK.
Step 3: Filter the Data
Right-click on Sales in the Rows area and select Filter. Deselect any values below 1500.
The PivotTable will now show the number of unique salespeople in each region, but only if their sales are above 1500.






















