# COUNTUNIQUE formula generator

> Describe what you need and get a COUNTUNIQUE formula for Google Sheets, run on real data before you copy it. Plus 4 tested COUNTUNIQUE examples.

Source: https://spreadsheetpractice.com/tools/formula-generator/countunique · Updated October 29, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

COUNTUNIQUE counts how many different values appear in a range, ignoring blank cells.

Describe the task at [COUNTUNIQUE formula generator](https://spreadsheetpractice.com/tools/formula-generator/countunique) and get a COUNTUNIQUE formula for Google Sheets, tested on real data.

## Tested COUNTUNIQUE examples

### Count unique values

`=COUNTUNIQUE(B2:B12)`

Google Sheets. Result on the sample sheet: 7. [See it and try it](https://spreadsheetpractice.com/formulas/count-distinct-values-with-countunique)

### Count unique values with a condition

`=COUNTUNIQUE(FILTER(B2:B12,C2:C12=F1))`

Google Sheets. Result on the sample sheet: 3. [See it and try it](https://spreadsheetpractice.com/formulas/count-unique-values-with-a-condition)

### Count unique values

`=COUNTA(UNIQUE(A2:A10))`

Excel. Result on the sample sheet: 5. [See it and try it](https://spreadsheetpractice.com/formulas/count-unique-values)

### Count unique values across multiple columns

`=COUNTA(UNIQUE(TOCOL(B2:D6,1)))`

Excel. Result on the sample sheet: 7. [See it and try it](https://spreadsheetpractice.com/formulas/count-unique-values-across-multiple-columns)

## Questions

### What does the COUNTUNIQUE formula generator do?

You describe the task in plain English, and it writes the formula, using COUNTUNIQUE where that's the right tool, for your table or a sample one. The formula is run in our engine in Google Sheets mode before you see it, so you get its result, not just a guess.

### What does COUNTUNIQUE do?

COUNTUNIQUE counts how many different values appear in a range, ignoring blank cells.

### Can I learn to write COUNTUNIQUE formulas myself?

Yes. Each example below opens a page where you try the formula in a live grid and it's checked as you go, and the COUNTUNIQUE function page has a practice exercise.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
