Lists that spill · About 4 minutes
List each value once with UNIQUE
UNIQUE takes a column with repeats and gives back each value once. =UNIQUE( lists every customer in A2:A9, in the order they first appear.
You type it in one cell, and the answer spills: it fills the cells below by itself. If something is already in the way, the cell shows #SPILL! until there is room (Google Sheets shows #REF! instead).
These work in Excel 365, Excel 2021 or later and Google Sheets. Excel 2016 and 2019 don't have them.
Part of Plus
Free during our founding launch: sign in to unlock this lesson's exercises, the timed practice sets and the rest of Plus. The free lessons stay free, with no account needed.
What UNIQUE does
UNIQUE takes a list with repeats and gives back each value once, in the order each one first appears. A sign-up sheet with the same team written ten times becomes a short list of teams.
You type it in one cell and the answer spills: one formula fills the cells below it by itself. When the original list changes, the short list updates too.
How to write UNIQUE
=UNIQUE(
- array
- The cells to take the values from, like a column of team names.
- by_col
- Optional. Leave it out, or use FALSE, to compare rows. TRUE compares columns, for a list that runs across.
- exactly_once
- Optional. TRUE keeps only the values that appear exactly once in the list. Left out, every value is kept once.
UNIQUE worked example
A sign-up sheet lists each person's team. In C2, list each team once.
| A | B | C | |
|---|---|---|---|
| 1 | Name | Team | Teams |
| 2 | Ana | Red | Red |
| 3 | Raj | Blue | Blue |
| 4 | Mei | Red | Green |
| 5 | Tom | Green | |
| 6 | Zoe | Blue | |
| 7 | Eli | Red |
=UNIQUE( B2:B7)Look down B2 to B7 and keep each team the first time it appears: Red, Blue and Green spill into C2 to C4.Common UNIQUE mistakes
A #SPILL! error instead of a list
Something is in the cells the list needs, even a space. Clear the cells below the formula. Google Sheets shows #REF! with "Array result was not expanded" for the same thing.
The same value appears twice
The two cells differ in a way you can't see, often a space at the end, like "Red ". Clean the list with TRIM first, then run UNIQUE on the clean column.
The formula shows #NAME?
UNIQUE needs Microsoft 365 or Excel 2021 or later. Excel 2016 and 2019 don't have it. Google Sheets has it.
UNIQUE or Remove Duplicates?
The Remove Duplicates button deletes repeats from the data itself, once. UNIQUE leaves the data alone and builds a live list somewhere else, so it stays right as rows are added.
To count how many different values there are, put UNIQUE inside COUNTA, like COUNTA(. To get the list in A to Z order, put it inside SORT.
Questions people ask
How do I get a list of unique values in Excel?
=UNIQUE( lists each value in A2:A9 once, in the order it first appears.
What does #SPILL! mean?
The answer needs the cells below, and something is already in them. Clear those cells and the list appears. Google Sheets shows #REF! instead.
Which versions have UNIQUE?
Excel 365, Excel 2021 and Google Sheets. Excel 2016 and 2019 don't have it.
How do I count the unique values?
Wrap it in COUNTA: =COUNTA(.