Cellgrids Cellgridsby LearnWithRinkesh
Home › Excel tutorials › UNIQUE Function in Excel (Remove Duplicates with a Formula)

How to Use the UNIQUE Function in Excel to Get a List Without Duplicates

By Rinkesh Shah · Business Analyst, 8 years in data · Updated 2026-10-31

▶ Video coming soon

UNIQUE returns the distinct values from a range and spills them into the cells below. Unlike the Remove Duplicates button, it does not change your data and it updates by itself when the data changes. It is available in Microsoft 365 and Excel 2021 or newer.

Syntax

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

Get a distinct list of departments

If departments sit in A2:A500, type this in one cell:

=UNIQUE(A2:A500)

Excel fills the list downwards on its own. Do not type anything in the cells below, or you will get a #SPILL! error.

Count how many unique items you have

Wrap UNIQUE inside COUNTA:

=COUNTA(UNIQUE(A2:A500))

This is the quickest way to answer questions like how many different customers placed an order this month.

Find items that appear only once

=UNIQUE(A2:A500,,TRUE)

Two commas in a row skip the second argument. This is useful to find a customer who bought only a single time.

Sort the unique list

Put SORT around it for an alphabetical list:

=SORT(UNIQUE(A2:A500))

Unique rows across two columns

If you select two columns, for example A2:B500, UNIQUE compares the full row. A repeated pair of Region and Product is removed, but the same Region with a different Product is kept.

Common mistakes

Worked example

Cities in A2:A100 with repeats. =UNIQUE(A2:A100) spills each city once. =UNIQUE(A2:A100,,TRUE) returns only cities that appear exactly once. Count of distinct: =COUNTA(UNIQUE(A2:A100)).

Common mistakes

Frequently asked questions

Does UNIQUE remove duplicates from the original?

No. It returns a separate list.

Can it work on several columns?

Yes. It returns unique rows across the columns.

Is it case sensitive?

No.

Practice this online, free

Reading is only half of learning Excel. Cellgrids is a free place for online Excel practice: solve Excel formula exercises in a live spreadsheet, prepare for Excel interview questions, and work through business case studies built for data analytics and business analytics roles.

Practice these formulas: UNIQUE, SORT, FILTER.

Start Excel practice → Case studies