MathBoth2026-07-12

Count Unique Values in a Range: 4 Methods Compared

Method 1: UNIQUE + COUNTA (Modern)

Excel 365 / Google Sheets: =COUNTA(UNIQUE(A2:A100))

Method 2: SUMPRODUCT (Legacy)

Works in all Excel versions: =SUMPRODUCT(1/COUNTIF(A2:A100,A2:A100))

Method 3: COUNTIFS for Conditional Unique

Count unique values where another column meets a condition.

Platform Notes

UNIQUE() is available in Excel 365 and Google Sheets. For older Excel versions, SUMPRODUCT is the only option. Google Sheets also supports =ROWS(UNIQUE(A2:A100)) as an alternative.

Need a custom formula?

Describe what you need in plain English and get the exact formula instantly.

Try the Generator →