FormulaCamp
Completed
← All functions
Dynamic arrays

UNIQUE

List without duplicates.

Syntax

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

Example: =UNIQUE(B2:B100)

Available in: Excel 2021+, Microsoft 365

UNIQUE returns the distinct values from a range and spills them into the cells below: =UNIQUE(array, [by_col], [exactly_once]). It is the fast way to get a list of categories, customers or regions without duplicates.

When to use it

Arguments explained

Worked examples

Distinct regions

ABC
1RegionRepAmount
2EastAna1200
3WestBen850
4EastCara430
5NorthDan970
6WestEli1500
7EastAna610

Formula: E2: =UNIQUE(A2:A7)

Result: Spills down: East, West, North

Keeps the first occurrence of each region, in order of appearance.

Count of distinct regions

ABC
1RegionRepAmount
2EastAna1200
3WestBen850
4EastCara430
5NorthDan970
6WestEli1500
7EastAna610

Formula: E2: =COUNTA(UNIQUE(A2:A7))

Result: 3

COUNTA counts the items in the unique list.

Values that appear once

ABC
1RegionRepAmount
2EastAna1200
3WestBen850
4EastCara430
5NorthDan970
6WestEli1500
7EastAna610

Formula: E2: =UNIQUE(B2:B7,,TRUE)

Result: Spills down: Ben, Cara, Dan, Eli

Setting exactly_once to TRUE drops Ana, who appears twice.

Try it

A tiny spreadsheet with example data. Edit the formula or any number and see the result.

Formula in F2: =UNIQUE(A2:A7)

Example spreadsheet for UNIQUE
ABCDEF
1RegionProductUnitsPriceResult
2EastPen1202.5East
3WestPen802.5West
4EastBook4512North
5NorthBook6012
6WestLamp3025
7EastLamp1525
Result in F2: East
Practice this in a lesson: UNIQUE and SORT

Common errors and how to fix them

Related functions

Frequently asked questions

How do I count unique values?
Use =COUNTA(UNIQUE(range)), or =SUM(1/COUNTIF(range,range)) in older Excel.
Can UNIQUE sort the list?
Wrap it in SORT: =SORT(UNIQUE(A2:A7)).
Does UNIQUE work on several columns?
Yes. It returns unique rows when the array has multiple columns.
Is UNIQUE case sensitive?
No. "east" and "East" are the same value.

More in Dynamic arrays