In Microsoft 365 and Excel 2021: =COUNTA(UNIQUE(A2:A100)). UNIQUE lists each value once and COUNTA counts the list. In older versions, =SUMPRODUCT(1/COUNTIF(A2:A100, A2:A100)) gives the same answer.
{"cells": {"A1": "Question", "A10": "Elm Studio", "A11": "Cedar Foods", "A12": "Alder Trading", "A13": "Birch Logistics", "A14": "Elm Studio", "A15": "Fern Dental", "A2": "Different clients", "A3": "Older Excel", "A4": "Clients in North", "A7": "Client", "A8": "Elm Studio", "A9": "Alder Trading", "B1": "Answer", "B10": "North", "B11": "East", "B12": "South", "B13": "North", "B14": "North", "B15": "North", "B2": "=COUNTA(UNIQUE(A8:A15))", "B3": "=SUMPRODUCT(1/COUNTIF(A8:A15,A8:A15))", "B4": "=COUNTA(UNIQUE(FILTER(A8:A15,B8:B15=\"North\")))", "B7": "Region", "B8": "North", "B9": "South"}, "focus": "B2", "note": "Add a new client name in column A, for example in A15."}
UNIQUE and COUNTA
The cleanest version in modern Excel.
=COUNTA(UNIQUE(A2:A100))How many different values.=COUNTA(UNIQUE(FILTER(A2:A100, B2:B100="North")))Different clients in the North region.SUMPRODUCT and COUNTIF (every version)
Each value contributes 1 divided by how often it appears, so a value that appears three times adds three thirds.
=SUMPRODUCT(1/COUNTIF(A2:A100, A2:A100))Distinct values; the range must have no empty cells.=SUMPRODUCT((A2:A100<>"")/COUNTIF(A2:A100, A2:A100&""))The same, safe with blank cells.A PivotTable
Tick Add this data to the Data Model when you create it, then choose Distinct Count in Value Field Settings.
Value Field Settings → Distinct CountDistinct values per group without formulas.Common mistakes
- #DIV/0! in the SUMPRODUCT version
- The range includes empty cells. Use the blank-safe version.
- Different spellings count separately
- "Elm Studio" and "Elm Studio " are two values. Clean the data with TRIM.
Frequently asked questions
Is the count case-sensitive?
No. "elm studio" and "Elm Studio" count once.
How do I list the unique values instead?
Use =UNIQUE(A2:A100). See remove duplicates.
How do I count values that appear only once?
=COUNTA(UNIQUE(A2:A100, , TRUE)).