How to Use UNIQUE Function in Excel
Extracting a list of distinct customers, products, or regions used to require Excel’s Remove Duplicates button, Pivot Tables, or complex legacy formulas. The UNIQUE function replaces those manual steps with a single formula that updates automatically whenever new rows are added to your data.
The UNIQUE function is part of Excel’s dynamic arrays suite and works in Microsoft 365, Excel 2021, Excel 2024, and Excel for the Web.
Table of Contents
UNIQUE Function Syntax
=UNIQUE(array, [by_col], [exactly_once])
- array (required): The range of cells from which to return unique rows or columns.
- by_col (optional): Enter
FALSE(or omit) to compare rows vertically. EnterTRUEto compare columns horizontally. - exactly_once (optional): Enter
FALSE(or omit) to return every distinct value once. EnterTRUEto return only values that appear strictly one time in the source data (excluding all duplicates).
Sample Dataset
Enter the following order log into cells A1:B9:
| Region | Rep |
|---|---|
| North | Anna |
| South | Mark |
| North | Anna |
| East | David |
| West | Elena |
| North | Sara |
| South | Mark |
| East | David |
Step-by-Step: Extract a Distinct List from One Column
Let us pull a clean list of every distinct Region from column A:
- Pick a clear output cell: Click cell
D2and ensure the cells directly below it are blank. - Enter the formula: Type the following formula:
=UNIQUE(A2:A9) - Press Enter: Excel spills four values down column D: North, South, East, and West.
Step-by-Step: Extract Unique Combinations Across Multiple Columns
You can pass multiple columns into UNIQUE to find every distinct pair of values.
- Click cell
F2with open cells to the right and below. - Enter the formula covering both columns:
=UNIQUE(A2:B9) - Press
Enter. Notice that North / Anna appears only once, while North / Sara is kept because the combination of Region and Rep is distinct.
Step-by-Step: Find Values That Appear Only Once
Sometimes you do not want a distinct list of all items; instead, you want to find items that have zero duplicates in the dataset (for example, one-time buyers).
- Click cell
I2. - Set the third argument (
exactly_once) toTRUE:=UNIQUE(A2:A9, FALSE, TRUE) - Press
Enter. Excel returns only West, because North, South, and East each appear more than once.
Bonus Tip: Count Unique Values in One Cell
Wrap UNIQUE inside COUNTA to get an instant count of distinct entries:
=COUNTA(UNIQUE(A2:A9))
If your range may contain empty cells, filter out blanks first or compare this approach with our classic methods to count unique values in Excel.
Using UNIQUE to Power Dynamic Drop-Down Lists
You can feed a spilled UNIQUE list straight into a Data Validation drop-down list. In the Data Validation Source box, point to the first cell of your formula followed by a hash symbol (#), such as =$D$2#. As new regions appear in your source table, your drop-down menu expands automatically.
Common Issues to Watch For
- #SPILL! error: A cell below your formula contains data or formatting that blocks the dynamic output. Clear the obstructing cells to resolve the error.
- Trailing spaces creating fake duplicates: Excel treats
"North"and"North "as two different values. Clean your input text with the TRIM function (for example,=UNIQUE(TRIM(A2:A9))). - Case insensitivity:
UNIQUEtreats"north"and"North"as identical and returns the capitalization of the first match it finds.



