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

Working on a sheet you inherited? Run the Auditor on the whole file first — it flags every #REF!, #N/A, broken column pattern, and inconsistent formula in seconds, free, no signup.

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: