5.5 C
London
Saturday, December 21, 2024
HomeSoftware TutorialsExcelExcel: How to Count Unique Values Based on Multiple Criteria

Excel: How to Count Unique Values Based on Multiple Criteria

Related stories

Learn About Opening an Automobile Repair Shop in India

Starting a car repair shop is quite a good...

Unlocking the Power: Embracing the Benefits of Tax-Free Investing

  Unlocking the Power: Embracing the Benefits of Tax-Free Investing For...

Income Splitting in Canada for 2023

  Income Splitting in Canada for 2023 The federal government’s expanded...

Can I Deduct Home Office Expenses on my Tax Return 2023?

Can I Deduct Home Office Expenses on my Tax...

Canadian Tax – Personal Tax Deadline 2022

  Canadian Tax – Personal Tax Deadline 2022 Resources and Tools...

You can use the following basic formula in Excel to count unique values based on multiple criteria:

=SUM(--(LEN(UNIQUE(FILTER(A:A,(Criteria1)*(Criteria2)*(Criteria3),"")))>0))

This particular formula counts the number of unique values in column A based on three criteria being met.

The following example shows how to use this formula in practice.

Example: Count Unique Values Based on Multiple Criteria in Excel

Suppose we have the following dataset in Excel that shows the conference and points scored for various basketball players:

Now suppose we’d like to count the number of unique player names who meet the following criteria:

  • The player is in the West conference.
  • The player has greater than 20 points.

We can use the following formula to count the number of unique player names who meet this criteria:

=SUM(--(LEN(UNIQUE(FILTER(A2:A14,(B2:B14="West")*(C2:C14>20),"")))>0))

We can type this formula into cell E2 of our spreadsheet:

From the output we can see there are 3 unique player names that are in the West conference and have more than 20 points.

We can verify this is correct by manually identifying each player who meets both criteria:

Out of the four players who meet both criteria, there are three unique player names:

  • Greg
  • Sean
  • Mike

Note that in this example we performed a count unique using two criteria, but we can use similar syntax to use as many criteria as we’d like.

Additional Resources

The following tutorials explain how to perform other common tasks in Excel:

Excel: How to Count If Cells Contain Text
Excel: How to Count Cells Not Equal to Value
Excel: How to Use COUNTIF with OR

Subscribe

- Never miss a story with notifications

- Gain full access to our premium content

- Browse free from up to 5 devices at once

Latest stories