The Excel UNIQUE function returns a list with the duplicates removed. Your original data stays as it is, the list is built somewhere else, and it updates when the source changes. UNIQUE is available in Microsoft 365, Excel 2024, Excel 2021 and Excel for the web, but not in Excel 2019 or older. Every result below was worked out by hand from the 12-row table shown, so you can type it in and compare.

UNIQUE syntax
=UNIQUE(array, [by_col], [exactly_once])
array is the range to check. by_col is optional: FALSE or left out compares rows (the usual case), TRUE compares columns, which you need for a list that runs across a row. exactly_once is optional too: FALSE or left out returns every different value once, TRUE returns only the values that appear a single time. Skipping by_col while setting exactly_once means two commas in a row: =UNIQUE(B2:B13,,TRUE).

The example table
Type this into A1:D13 with the headers in row 1. Every formula below uses rows 2 to 13.
| A: Customer | B: City | C: Product | D: Amount | |
|---|---|---|---|---|
| 2 | Mia | Austin | Pens | 120 |
| 3 | Noah | Boston | Pens | 80 |
| 4 | Liam | Austin | Ink | 45 |
| 5 | Emma | Denver | Pens | 60 |
| 6 | Zoe | Boston | Paper | 30 |
| 7 | Owen | Austin | Pens | 90 |
| 8 | Ella | Chicago | Ink | 50 |
| 9 | Jack | Boston | Pens | 70 |
| 10 | Ivy | Austin | Paper | 25 |
| 11 | Leo | Denver | Pens | 100 |
| 12 | Ruth | Chicago | Pens | 40 |
| 13 | Sam | Boston | Ink | 55 |
Get a unique list from one column
In F2, type =UNIQUE(B2:B13) and press Enter. Four cities spill down from F2 in the order they first appear: Austin, Boston, Denver, Chicago. Only F2 holds the formula. The cells under it are part of the spill and cannot be edited one by one. Austin and Boston each have 4 rows, Denver and Chicago 2 each, which adds up to the 12 rows in the table.
To sort the list, wrap it: =SORT(UNIQUE(B2:B13)) gives Austin, Boston, Chicago, Denver.
Unique rows across two columns
Give UNIQUE more than one column and a row only counts as a duplicate when every column matches. =UNIQUE(B2:C13) checks city and product together. Mia’s Austin and Pens (row 2) matches Owen’s (row 7), Noah’s Boston and Pens (row 3) matches Jack’s (row 9), and Emma’s Denver and Pens (row 5) matches Leo’s (row 11). Three rows are repeats, so 9 pairs come back.
exactly_once: “unique” means something else here
In everyday talk, “unique values” and “distinct values” mean the same thing. In Excel they do not. The plain UNIQUE call returns the distinct list. The third argument asks for the values that appear only once and drops anything that repeats, even its first appearance.
| Formula | Returns | Rows |
|---|---|---|
=UNIQUE(B2:B13) | Each city once | 4 |
=UNIQUE(B2:C13) | Each city and product pair once | 9 |
=UNIQUE(B2:C13,,TRUE) | Pairs that appear once | 6 |
=UNIQUE(B2:B13,,TRUE) | Cities that appear once | none: #CALC! |

Check the 6 by hand: the nine distinct pairs minus the three that appear twice leaves Austin and Ink, Boston and Paper, Chicago and Ink, Austin and Paper, Chicago and Pens, and Boston and Ink. The last row is the trap. Every city appears at least twice, so nothing qualifies and Excel returns #CALC! (an empty array). Wrap it when that can happen: =IFERROR(UNIQUE(B2:B13,,TRUE),"None").
Unique values across a row
Type Red, Blue, Red, Green, Blue, Red into H2:M2. A row of values is a single row to UNIQUE, so =UNIQUE(H2:M2) returns all six cells unchanged. Add TRUE for by_col, =UNIQUE(H2:M2,TRUE), and it compares column by column and returns Red, Blue, Green across three cells.
Count the unique values
=COUNTA(UNIQUE(B2:B13)) returns 4. If the list already sits in F2, point at the whole spill with the hash sign: =ROWS(F2#) also gives 4, and the result keeps up when the list grows or shrinks. For Excel 2019 and older there is a classic formula: =SUMPRODUCT(1/COUNTIF(B2:B13,B2:B13)). Each city adds up to exactly 1 (4 rows at a quarter each, 2 rows at a half each), so the total is 4. It is slow on big ranges and breaks on blank cells, because dividing by a zero count gives #DIV/0!.
Blank cells show up as 0
Say the data will grow to row 20 and you point UNIQUE at B2:B20 ahead of time. Rows 14 to 20 are empty, and the list now has five entries: the four cities plus a 0 for the blanks. Filter the blanks out first:
=UNIQUE(FILTER(B2:B20,B2:B20<>"")) returns the four cities only. This is also the safe form inside a count: =COUNTA(UNIQUE(FILTER(B2:B20,B2:B20<>""))) returns 4, where the plain version would say 5.

Use the list: totals and a drop-down
With the city list in F2, type =SUMIF(B2:B13,F2#,D2:D13) in G2. It spills one total beside each city: Austin 280 (120+45+90+25), Boston 235 (80+30+70+55), Denver 160 (60+100), Chicago 90 (50+40). The four add up to 765, the same as the whole Amount column, which is a quick sanity check.
For a drop-down that never needs updating, go to Data, Data Validation, choose List, and enter =$F$2# as the source. New cities appear in the drop-down as soon as they appear in the data.
Capital letters: UNIQUE ignores case, so “Austin” and “austin” count as the same value and the first spelling is kept. Extra spaces do count: “Austin ” with a trailing space is a different value. Clean the column with TRIM first, =UNIQUE(TRIM(B2:B13)), when data comes from copy and paste.
UNIQUE errors and fixes
#SPILL! means something already sits in the cells the list needs, such as a stray value or a merged cell. Clear that space and the list appears. #NAME? usually means the Excel version has no UNIQUE (2019 or older), or the name is misspelled. #CALC! means the result is empty, which happens with exactly_once when nothing appears only once. #REF! can appear if UNIQUE points at another workbook that is closed. A formula that spills cannot live inside an Excel Table, so put it in a normal cell next to the table instead.
Google Sheets and older Excel
Google Sheets has the same function with the same three arguments in the same order, =UNIQUE(B2:B13), and returns rows in the order they first appear. There is no hash sign in Sheets. To refer to a spilled list, use an open range such as F2:F. In Excel 2019 or older, use Data, Remove Duplicates. It deletes the repeats in the original, so work on a copy of the column.

Frequently asked questions
What does the UNIQUE function do in Excel?
It returns the different values of a range, each one once, and spills them into the cells below. =UNIQUE(B2:B13) turns twelve rows of cities into a list of four.
How do I get only values that appear once?
Set the third argument to TRUE: =UNIQUE(B2:C13,,TRUE). Values that repeat are dropped completely. If nothing appears once, the result is #CALC!.
Why does my UNIQUE list end with a 0?
The range contains blank cells and UNIQUE returns them as 0. Remove them first with =UNIQUE(FILTER(B2:B20,B2:B20<>"")).
Is UNIQUE case sensitive?
No. “Austin” and “austin” are treated as the same value. Extra spaces are not ignored, so use TRIM on messy data.
Which Excel versions have UNIQUE?
Microsoft 365, Excel 2024, Excel 2021 and Excel for the web. Excel 2019 and older show #NAME?.
Sources: Last checked November 2026. Microsoft Support: UNIQUE function; Exceljet: UNIQUE; Google: UNIQUE in Google Sheets.