New: ready-to-use spreadsheet templatesExplore the collection  →
PASTE-READY RECIPE

Count Unique Values with Criteria in Google Sheets

Count distinct entries after limiting rows to a chosen status or group.

Written by JosephinePublished July 27, 2026Updated July 27, 2026Visual demo planned
QUICK ANSWER

The formula and where it fits.

Count distinct entries after limiting rows to a chosen status or group. Use =COUNTUNIQUE(FILTER(A2:A,B2:B="Paid")), then replace the sample ranges with the columns in your sheet.

FILTER keeps matching rows; COUNTUNIQUE counts the remaining distinct entries.

  1. Put the source data under one header row.
  2. Paste the formula into an empty result cell.
  3. Change the ranges and criteria to match your sheet.
  4. Check the result against one row you can verify manually.
TRY IT

Edit the table.
Watch the result change.

EDITABLE INPUT DATA
fx=COUNTUNIQUE(FILTER(A2:A,B2:B="Paid"))
AB
1CustomerStatus
2
3
4
5
FORMULA OUTPUT2Recalculates from the input cells above
VARIATIONS

Use the version that fits your sheet.

01

Two criteria

=COUNTUNIQUE(FILTER(A2:A,B2:B="Paid",C2:C="West"))

Adds a region condition.

02

Ignore blanks

=COUNTUNIQUE(FILTER(A2:A,B2:B="Paid",A2:A<>""))

Excludes empty names.

03

Date window

=COUNTUNIQUE(FILTER(A2:A,B2:B>=E1,B2:B<=F1))

Counts distinct entries between two dates.

COMMON ERRORS

When the result looks wrong.

No rows match

Wrap the formula in IFERROR and return 0.

Extra spaces create separate names

Clean the source with TRIM before counting.

QUESTIONS

Answers before you paste.

No rows match

Wrap the formula in IFERROR and return 0.

Extra spaces create separate names

Clean the source with TRIM before counting.

MAKE IT YOURS

Change the ranges, labels or criteria.

Send this recipe to the SheetSteps assistant and describe how your columns are arranged.

Adjust this formula