How UNIQUE works in Excel? Best UNIQUE examples

How UNIQUE works in Excel? Best UNIQUE examples

When working with Excel, dealing with duplicate data can be frustrating. Luckily, Excel provides a dynamic array function called UNIQUE that helps extract distinct values from a list. Whether you’re cleaning up data, analyzing trends, or creating custom drop-down lists, UNIQUE can save time and effort.

Understanding the UNIQUE Function in Excel

The UNIQUE function extracts distinct values from a range or array. It dynamically updates as the source data changes, making it incredibly powerful for real-time data analysis.

The basic syntax of the UNIQUE function is:

=UNIQUE(array, [by_col], [exactly_once])
  • array – The range or array from which to extract unique values.
  • by_col (optional) – A TRUE or FALSE value determining whether to compare values by column. Default is FALSE (row-wise comparison).
  • exactly_once (optional) – If set to TRUE, returns values that appear only once (removing duplicates entirely).

Basic Example of UNIQUE

Let’s start with a simple dataset:

A
Apple
Banana
Apple
Grape
Banana
Mango

If we apply the formula:

=UNIQUE(A2:A7)

Excel will return:

  • Apple
  • Banana
  • Grape
  • Mango

Using UNIQUE to Find Values That Appear Only Once

If we modify the formula to ensure we retrieve only values that appear exactly once:

=UNIQUE(A2:A7, FALSE, TRUE)

The result will be:

  • Grape
  • Mango

Since “Apple” and “Banana” appeared more than once, they are removed from the output.

Using UNIQUE with Multiple Columns

The UNIQUE function can also work with tables containing multiple columns. Consider this dataset:

Name Department
John Sales
Mary IT
John Sales
Anna Marketing

Using:

=UNIQUE(A2:B5)

The output will be:

Name Department
John Sales
Mary IT
Anna Marketing

Notice that only unique row combinations are kept.

UNIQUE with SORT for Ordered Results

Sometimes, it’s useful to return unique values in a sorted order. We can combine UNIQUE with SORT like this:

=SORT(UNIQUE(A2:A7))

The result will be an alphabetically sorted list of unique values.

Common Errors and Troubleshooting

While using UNIQUE is straightforward, you should watch out for common mistakes:

  • #VALUE! Error – If the provided array is not valid, Excel may return this error.
  • Not Available in Older Versions – UNIQUE is only available in Excel 365 and Excel 2019 with dynamic array support.
  • Spilled Range Issues – Since UNIQUE returns an array, ensure no other data is blocking the spill range.

Best Use Cases for UNIQUE in Excel

Here are some practical applications of the UNIQUE function:

  1. Data Cleaning – Removing duplicate entries in a list.
  2. Drop-Down Lists – Creating unique values for data validation.
  3. Analyzing Survey Results – Extracting distinct responses from a dataset.
  4. Tracking Inventory – Identifying unique products in stock.
  5. Financial Reports – Summarizing unique transactions.

Conclusion

The UNIQUE function in Excel is a game-changer for working with data. Whether you’re eliminating duplicates, analyzing trends, or creating custom lists, it’s an essential tool that simplifies your workflow. By combining it with other functions like SORT and FILTER, you can unlock even more powerful data management possibilities.

 

Other interesting article:

How TRANSPOSE works in Excel? Best TRANSPOSE examples