UNIQUE Function
Returns unique values (spills the result).
Syntax
Parameters
| Parameter | Description | Required |
|---|---|---|
| array | The range or array from which to extract unique values. | Required |
| by_col | FALSE to compare across rows (default) or TRUE to compare across columns. | Optional |
| exactly_once | FALSE to return all distinct values (default) or TRUE to return only values that occur exactly once. | Optional |
Basic Example
Extract distinct values from a list
=UNIQUE(A2:A10)UNIQUE removes duplicates and spills the distinct list.
Advanced Examples
Example 1: Values that appear only once
Find items with no duplicates in a column.Set exactly_once to TRUE
=UNIQUE(A2:A10, , TRUE)Example 2: Unique across columns
Distinct values in a single row.Set by_col to TRUE
=UNIQUE(A1:D1, TRUE)How UNIQUE Works
UNIQUE returns the distinct values from array. By default it compares values down rows (by_col FALSE) and returns all distinct values. Setting by_col TRUE compares across columns; setting exactly_once TRUE returns only values that occur once. Results spill as a dynamic array.
Important Notes & Limitations
Microsoft 365 / Excel 2021+ only.
Comparison is case-insensitive by default; 'Apple' and 'apple' are treated as equal.
Returns a spilled array, so it needs empty room below/right.
Common Errors & Fixes
#SPILL!No room for the spilled results.Fix: Clear the cells in the spill range.
Case variants treated as duplicatesUNIQUE is case-insensitive.Fix: Use a helper column with EXACT for case-sensitive uniqueness.
Download Practice File
UNIQUE
uniquePractice UNIQUE with Real Data
Download a sample CSV file with pre-populated data and practice exercises for the UNIQUE function. Works in both Excel and Google Sheets.
File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps