Skip to content
Google Sheets functionNot in Excel

COUNTUNIQUE function in Excel

Excel doesn't have COUNTUNIQUE — here's what does.

Excel counts distinct values by spilling them with UNIQUE and measuring the result.

What COUNTUNIQUE does in Google Sheets

Counts the number of unique values in a list of specified values and ranges.

=COUNTUNIQUE(value1, [value2, ...])

Convert COUNTUNIQUE formulas to Excel

Before and after, formula by formula.

  1. Count distinct customers in a column:

    Google Sheets
    =COUNTUNIQUE(A2:A100)
    Excel
    =ROWS(UNIQUE(FILTER(A2:A100, A2:A100 <> "")))

    COUNTUNIQUE ignores empty cells; the FILTER keeps that behavior — Excel's UNIQUE would otherwise count blank as a value.

  2. Count distinct combinations of two columns:

    Google Sheets
    =COUNTUNIQUE(A2:A100 & "|" & B2:B100)
    Excel
    =ROWS(UNIQUE(A2:B100))

    Excel's UNIQUE de-duplicates whole rows natively — no concatenation trick needed.

Worth knowing

  • UNIQUE needs Excel 2021+. Older Excel falls back to =SUMPRODUCT((A2:A100<>"")/COUNTIF(A2:A100, A2:A100 & "")).

Converting more than one formula? The Excel ↔ Sheets translator rewrites whole workbooks and flags every COUNTUNIQUE so none slip through silently.

Browse Google Sheets math functions