FormulaCraft

How to count unique values in Excel and Google Sheets

Excel & Google Sheets
=COUNTA(UNIQUE(A2:A100))

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Enter =COUNTA(UNIQUE(A2:A100)).
  2. 2UNIQUE produces the distinct list; COUNTA counts those entries.
  3. 3The result is the number of different values in the range.

Tips

Need it for your exact data?

Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.

Frequently asked

How do I count distinct values, not total entries?

COUNTA counts everything; wrap UNIQUE inside it — =COUNTA(UNIQUE(range)) — to count only distinct values.

Formulas used

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: