COUNT UNIQUE Values Excel

If you just need to count unique values excel and move on, the boxed answer at the top is all you need. The rest of this page is for when you want to understand why it works in Excel, adapt it to a trickier version, or make it robust enough to hand to a colleague. We keep the opening short on purpose — the depth is here when you want it, not in your way when you don’t.

Exact answer

In Excel: use =UNIQUE(array) — a dynamic-array function that returns a distinct list from a range and spills the result down or across automatically.

Syntax

=UNIQUE(array, [by_col], [exactly_once])

Arguments

ArgumentDescription
arrayrequiredThe range or array to extract distinct values from.
by_coloptionalFALSE or omitted compares and returns rows; TRUE compares and returns columns.
exactly_onceoptionalTRUE returns only items that appear exactly once; FALSE or omitted returns one of each distinct item.

Related functions

FILTERCOUNTIF
ƒxDuplicate RemoverLive
Unique values
3

2 duplicates removed · 3 kept

Runs entirely in your browser — your data never leaves this page.
Ctrl+CthenCtrl+Shift+V+Cthen+Ctrl+VPaste values · WindowsMac

What this does

UNIQUE is a dynamic-array function in Excel 365 and Excel 2021 that returns the distinct values from a range, spilling the live result into the cells below. Unlike the Remove Duplicates data tool — a one-off action that permanently edits your data — UNIQUE is a formula that recalculates whenever the source changes, so a dropdown or report stays current. The optional by_col switches it to compare columns instead of rows, and exactly_once returns only the items that occur a single time. Because it spills, it needs empty cells below; if something blocks the spill it returns a #SPILL! error. Keep the inputs visible and clearly labelled and the whole thing stays auditable — anyone who opens the file later, including you, can see at a glance exactly what feeds the result and change one assumption without hunting through the formula. Treat “count unique values excel” as a small repeatable workflow rather than a one-off click you hope to remember next time. Use a small test block before the live file, so any surprise in the affected cells shows up while it is still harmless. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That turns a data step that keeps your analysis trustworthy into a method you can reuse, explain, and defend when the workbook leaves your screen.

A worked example

Region names with repeats sit in A2:A100. =UNIQUE(A2:A100) spills a clean list of each region once — say West, East, North, South — into the cells below the formula. To list only regions that appear exactly once, add the third argument: =UNIQUE(A2:A100, FALSE, TRUE). To sort the distinct list, wrap it: =SORT(UNIQUE(A2:A100)). UNIQUE is the modern way to build live distinct lists — for dashboards, dropdowns and summaries — because it updates automatically and, unlike Remove Duplicates, never alters the underlying data. A practical tip before you scale it up: build it once on a small block of test data, confirm the number against the tool on this page, and only then point it at your real sheet. That one habit catches almost every mistake while it is still cheap to fix, long before a wrong figure reaches a report or a colleague.

In Google Sheets

Everything above works in Google Sheets too. Excel and Sheets share the formula syntax used here; only the surrounding menus are arranged differently. That portability is deliberate — learn it once and it follows you between the two tools and across Windows and Mac. The aim was to get you unstuck fast and leave you a little more capable than a copy-paste would. The answer is at the top, the tool proves it, and the detail above shows why it holds — so the next time a colleague asks, you can answer without reaching for search. The short version of “count unique values excel”: the answer is at the top of this page, the tool proves it on your own numbers, and the sections above explain why it holds so the next variation does not stump you. Excel rewards people who reference cells instead of typing values and who keep inputs separate from formulas, because that is what makes a result you can audit months later. Build it once, deliberately, with the live tool as a check, and you convert a one-off lookup into a reusable skill — which is the whole point of learning the why and not just the what.

Common mistakes

  • Placing the formula where cells below are occupied, which blocks the spill and returns a #SPILL! error — clear the range underneath.
  • Confusing UNIQUE with Remove Duplicates — Remove Duplicates is a one-off tool that deletes data, while UNIQUE is a live formula that leaves the source intact.
  • Using UNIQUE in Excel 2019 or earlier, where it does not exist and returns #NAME?; fall back to Remove Duplicates or an advanced filter there.

Frequently asked questions

What is the difference between UNIQUE and Remove Duplicates?

UNIQUE is a formula that spills a live distinct list and updates when the source changes, leaving your data untouched. Remove Duplicates is a one-off button on the Data tab that permanently deletes the duplicate rows from the data itself.

Why does UNIQUE return a #SPILL! error?

Something is occupying the cells where the result needs to spill. Clear or move the contents below the formula so the distinct list has room, and the spill resolves.

How do I get a sorted list of unique values?

Wrap UNIQUE in SORT: =SORT(UNIQUE(A2:A100)) returns the distinct values in ascending order, perfect for a tidy dropdown source.

Other ways people ask this

On the way here you may have searched this as “how to count unique values in excel”, “count of unique values in excel”, “unique value count in excel” and “excel formula count unique values” — it is all the same task, and this page is the single, complete answer to it.

This guide also answers

  • count number of unique values in excel
  • counting unique values in excel
  • excel sum by unique value
  • sum unique values excel

Why do people search for this in so many different ways?

Because the same task has many names. “how to count unique values in excel”, “count of unique values in excel”, “unique value count in excel” all point at the one operation explained on this page, which is why they all lead here.