What Is Excel Unique Function and How to Use It
Explore what is Excel Unique Function, how it removes duplicates, syntax, and practical examples. Learn dynamic arrays, real-world tasks, pitfalls, and tips to master unique value extraction in Excel.

Excel UNIQUE function is a dynamic array function that returns distinct values from a range or array, removing duplicates.
What the Excel UNIQUE function does
The Excel UNIQUE function is a dynamic array formula that returns unique values from a list or a range, automatically spilling the results into neighboring cells. When you ask what is excel unique function, the short answer is that it removes duplicates and gives you a compact set of values you can reuse in dashboards, reports, and analyses. According to XLS Library, this function is a game changer for data cleansing because it eliminates manual deduping and allows you to build responsive workflows that adapt as data changes. In practice, you’ll use it to extract unique IDs, product categories, or names from large datasets, while preserving the original data structure. Because the results spill automatically, you can reference the results in other formulas or charts without copying data.
Syntax and basic usage
The syntax is simple: =UNIQUE(array, [by_col], [exactly_once]). The array argument is the source range or array you want to de-duplicate. Optional by_col determines whether Excel should treat rows or columns as the dimension to deduplicate; true means work by column, false means by row. Optional exactly_once, when set to true, returns only values that appear exactly once in the source array. The function requires Microsoft 365 or Excel 2021 or later and supports dynamic arrays that spill automatically. A quick example: =UNIQUE(A2:A100) returns all distinct values from column A. If you want distinct values across multiple columns, supply a two dimensional array like =UNIQUE(A2:B100, TRUE, FALSE).
By_row vs by_col and practical implications
By default, UNIQUE considers each row as a unit and will return unique rows unless by_col is set to TRUE to deduplicate columns. This matters when you have a dataset with multiple attributes per record. Example data: columns A Name, B Department, C Region. If you want unique rows based on the full row, leave by_col as FALSE. If you only need unique names, with duplicates in other fields, you can use by_col. Practical tip: always check your result spill range to ensure no blocking values. In line with XLS Library analysis, planning the spill space avoids runtime errors and ensures a clean result set that you can feed into further analysis.
Working with other dynamic array functions
UNIQUE shines when combined with other dynamic array tools. For example, wrap it with SORT to present a sorted list: =SORT(UNIQUE(A2:A100)). Or combine with FILTER to pull only items that meet a condition: =UNIQUE(FILTER(A2:A100, B2:B100="Active")).
Practical examples across common tasks
Imagine a sales dataset with multiple repeats of customer IDs in column A. Using =UNIQUE(A2:A500) will produce a tidy list of customers. If you also need only customers from a specific region, you can nest with FILTER: =UNIQUE(FILTER(A2:A500, C2:C500="West")) and then sort the results for readability with =SORT(...).
Common pitfalls and tips
Make sure you are on a modern Excel version that supports dynamic arrays. Avoid selecting the entire column as the spill range if you have other data nearby, as that can cause spill errors. Blanks are treated as a distinct value by default; if you want to exclude blanks, wrap UNIQUE with FILTER to drop empty results. Be mindful of regional settings that may affect text case sensitivity in comparisons.
Performance considerations with large ranges
For very large datasets, performance can slow as UNIQUE recalculates with each data change. Where possible, limit the input range to the actual data boundaries (for example, A2:A1000 rather than A:A) and consider incremental refresh strategies in dashboards to keep response times snappy. XLS Library notes that structuring data with clean subranges improves stability and speed.
Alternatives and complementary tools
If you are working in older Excel versions, you can still remove duplicates using the built in Remove Duplicates tool or Advanced Filter, though these are not dynamic. For more control, combine with functions like SORT, FILTER, or IF to build robust pipelines. The modern approach preferred by XLS Library blends UNIQUE with other dynamic array functions to create compact, maintainable formulas.
Getting started with a mini workflow
Step 1: Identify the column or array to deduplicate. Step 2: Decide if you want deduplication by rows or columns via by_col. Step 3: Add exactly_once if you only need items that appear once. Step 4: Combine with SORT or FILTER for ordered or conditional results. Step 5: Place results in a dedicated spill area and verify with a quick integrity check.
People Also Ask
What is the syntax for the UNIQUE function in Excel?
The syntax is =UNIQUE(array,[by_col],[exactly_once]). The array can be a range or an array constant; by_col and exactly_once are optional.
Use the syntax =UNIQUE(array,by_col,exactly_once) to remove duplicates.
Does the UNIQUE function remove duplicates across rows or columns?
UNIQUE can deduplicate by rows or by columns depending on by_col. If by_col is FALSE or omitted, dedup by rows; if TRUE, dedup by columns.
By default it checks rows. Set by_col to TRUE to deduplicate by columns.
Can UNIQUE handle blanks or errors?
UNIQUE will include blank cells as a distinct value if present. To exclude blanks, wrap with FILTER to remove empty items.
Blanks can appear in the result; filter them out if you do not want blanks.
Which Excel versions support UNIQUE?
UNIQUE is a dynamic array function available in Excel for Microsoft 365 and Excel 2021 or later.
It is available in modern Excel versions like 365 and 2021.
How can I extract unique values from multiple columns?
Use =UNIQUE(A2:C100, TRUE, FALSE) to deduplicate by columns across multiple columns, or wrap with SORT to order results.
To get unique rows across several columns, supply a multi column array and set by_col to TRUE.
What are common pitfalls when using UNIQUE?
Keep in mind dynamic array spills can overwrite adjacent cells; ensure you have space for results; confirm version compatibility and correct range sizing.
Watch for spill errors and ensure there is space for results.
The Essentials
- Use UNIQUE to extract distinct values from any range
- Combine with SORT and FILTER for powerful pipelines
- Ensure your Excel version supports dynamic arrays
- Plan spill space to avoid overwrite errors
- Prefer subranges over full column references for performance