UNIQUE Function

The UNIQUE function returns unique values from a range or array, eliminating duplicates automatically. Perfect for creating distinct lists from data.

ExcelExcel
Google SheetsGoogle Sheets
array
intermediate
Syntax Preview
ExcelExcelGoogle SheetsGoogle Sheets
=UNIQUE(array, [by_col], [exactly_once])
Quick Answer
Comprehensive Explanation
Syntax and Parameters

Practical Examples

Basic Product List

Extract unique products from a sales database

Result: Laptop,Mouse,Keyboard,Monitor,Headset

Multi-Column Unique Combinations

Find unique customer-product combinations for cross-sell analysis

Result: John Smith,Laptop,Jane Doe,Mouse,Bob Wilson,Keyboard

Values Appearing Only Once

Identify single-occurrence items for special handling

Result: Special Order #12345,Custom Build #789,One-Time Service

Dynamic Dropdown Source

Create self-updating validation list for data entry

Result: Accounting,Engineering,HR,Marketing,Sales

Cross-Reference Analysis

Compare unique values between two datasets

Result: Product-X,Product-Y,Product-Z

Common Errors and Solutions

#SPILL!

UNIQUE result cannot spill due to blocked cells

Cause:

The cells where UNIQUE needs to output results contain data or merged cells

Solution:

1. Clear the spill range by deleting content below the formula cell 2. Remove any merged cells in the output area 3. Move the formula to a location with sufficient empty space 4. Use INDEX to extract specific values if space is limited

Prevention:

Always place UNIQUE formulas in areas with ample empty space below and to the right

Frequency: 35%

Example:

#VALUE!

Invalid parameter types or incompatible data

Cause:

Mixing incompatible data types or using text values for boolean parameters

Solution:

1. Ensure by_col parameter is TRUE or FALSE (or 1/0) 2. Check that exactly_once is a boolean value 3. Verify the source range contains valid data 4. Remove any error values from the source range

Prevention:

Use explicit TRUE/FALSE for optional parameters and clean source data first

Frequency: 20%

Example:

#NAME?

Function not recognized in current Excel version

Cause:

UNIQUE is only available in Excel 365/2021+ and Google Sheets, not in older Excel versions

Solution:

1. Upgrade to Excel 365 or Excel 2021 2. Use Google Sheets which supports UNIQUE 3. Alternative: Use Remove Duplicates feature (Data tab) 4. Alternative: Use Advanced Filter with 'Unique records only'

Prevention:

Check Excel version before using dynamic array functions

Frequency: 25%

Example:

#REF!

Invalid range reference or deleted source data

Cause:

The source range has been deleted, moved, or the reference is invalid

Solution:

1. Verify the source range exists and is accessible 2. Re-establish the range reference 3. Use structured references for table data 4. Check for broken links if referencing other workbooks

Prevention:

Use table references or named ranges for more stable references

Frequency: 15%

Example:

Incomplete Results

Not all unique values are displayed

Cause:

Excel's row limit reached, or exactly_once parameter filtering too aggressively

Solution:

1. Check if exactly_once is set correctly (FALSE for all unique values) 2. Verify source range includes all data 3. Check for leading/trailing spaces causing false duplicates 4. Use TRIM to clean text data before applying UNIQUE

Prevention:

Clean and normalize data before applying UNIQUE function

Frequency: 5%

Example:

Advanced Tips and Techniques

Modern Excel and Sheets allow powerful combinations. Try =SORT(UNIQUE(data)) for alphabetical unique lists, or =FILTER(UNIQUE(data), LEN(UNIQUE(data))>0) to remove blanks from results.

For datasets over 10,000 rows, reference specific ranges instead of entire columns. Using A2:A10000 instead of A:A can improve calculation speed by 5-10x.

UNIQUE is case-sensitive. 'Apple' and 'apple' are treated as different values. Use UPPER or LOWER to standardize case if needed.

UNIQUE requires Excel 365/2021+ or Google Sheets. For Excel 2019 and earlier, use Remove Duplicates feature or create helper columns with COUNTIF.

Create dynamic dropdown lists by using UNIQUE as the source for Data Validation. The list auto-updates as new unique values appear in your data.

UNIQUE works across sheets and even workbooks. Use it to consolidate unique values from multiple data sources into a master list.

UNIQUE vs Alternative Methods
Best Use Cases

Need Help with UNIQUE Function?

Stop struggling with formula syntax. Use AskFormulas to generate validated formulas instantly with our AI-powered tool.

Example Excel formula:

Related Formulas

FILTER Function in Excel

Master the FILTER function to dynamically extract data meeting specific criteria. Learn syntax, examples, and error solutions for Excel 365 and Sheets.

intermediate
array
ExcelExcel
Validated