
The UNIQUE function in Excel returns the distinct values from a range, and it updates by itself when the data changes. The basic formula is =UNIQUE(A2:A100). It is available in Excel 365 and Excel 2021 or later, not in older versions. This guide shows how to list unique values, find values that appear only once, count them, combine UNIQUE with SORT and FILTER, and fix the #SPILL! error. The sample data is made up.
UNIQUE function in Excel: syntax
=UNIQUE(array, [by_col], [exactly_once])
- array is the range to check.
- by_col is optional. FALSE (the default) compares rows, TRUE compares columns.
- exactly_once is optional. TRUE returns only values that appear a single time. FALSE (the default) returns each distinct value once.

List unique values from a column
For a list of customer names in A2:A100, type this in an empty cell:
=UNIQUE(A2:A100)
The results spill into the cells below. Those cells must be empty. If the list has blank cells, one blank may show up as a 0 in the results, so use the FILTER step below to remove it.

Unique rows across several columns
Select two or more columns, such as A2:B100 for customer and product. UNIQUE then treats each row as one item and returns the different combinations:
=UNIQUE(A2:B100)
Values that appear only once
Set the third argument to TRUE:
=UNIQUE(A2:A100, FALSE, TRUE)
This returns names that occur exactly one time. A name that appears twice is left out completely, which is different from the default behaviour that keeps one copy.

Sort the unique list
Wrap UNIQUE in SORT to get an alphabetical list:
=SORT(UNIQUE(A2:A100))
Remove blanks from the result
=UNIQUE(FILTER(A2:A100, A2:A100<>""))
FILTER drops the empty cells first, then UNIQUE removes the duplicates. The FILTER function is explained in our Excel FILTER guide.
Count the unique values
=COUNTA(UNIQUE(A2:A100))
This gives the number of different values. For counts that need a condition, filter first: =COUNTA(UNIQUE(FILTER(A2:A100, B2:B100="East"))). If you are comparing the three counting functions, see COUNT, COUNTA and COUNTBLANK.
Is UNIQUE case sensitive?
No. UNIQUE treats "Ann" and "ann" as the same value. Extra spaces still make values different, so clean the text first. Our guide to removing extra spaces in Excel shows how.
UNIQUE or Remove Duplicates?
Remove Duplicates changes your data for good. UNIQUE leaves the source alone and gives a separate, live list. Use UNIQUE when the data keeps changing, and the tool in the Data tab for a one-time clean up. The steps for the tool are in our remove duplicates guide.
Fix the #SPILL! error
- Cells in the way. Something is in the spill range. Clear those cells.
- Merged cells. Spilled formulas cannot spill into merged cells.
- Table. Spilled formulas do not work inside an Excel table. Put the formula outside it.

Questions and answers
Which Excel versions have UNIQUE?
Excel 365 and Excel 2021 and later. Excel 2019 and older do not have it.
How do I use UNIQUE in an older Excel?
Use Remove Duplicates on a copy of the column, or a Pivot Table, which lists each item once.
Can I reference the whole spilled list?
Yes. Type the first cell followed by a hash sign, for example =COUNTA(D2#), and the formula follows the size of the list.
Is there a similar function in Google Sheets?
Yes, Google Sheets has UNIQUE too. See our UNIQUE examples for Google Sheets.
