How to Use UNIQUE in Excel: A Practical Guide
Learn how to use UNIQUE in Excel to extract distinct values, build clean lists, and power data analysis with dynamic arrays. Includes syntax, examples, tips for Windows and Mac.

Learn how to use the UNIQUE function in Excel to extract distinct values from a range, build clean lists, and power data analysis. You'll master syntax, practical patterns, spill behavior, and troubleshooting across Excel for Windows and Mac, including dynamic array considerations and compatibility with older versions. This quick guide helps you apply UNIQUE to dashboards, data validation, and reporting tasks.
What UNIQUE does in Excel
The UNIQUE function returns distinct values from a range and spills them into adjacent cells. It relies on dynamic arrays, so you can place one formula and get a full column or row of results. In practice, UNIQUE helps remove duplicates before analysis, dashboards, or reporting. According to XLS Library, mastering UNIQUE lays a foundation for reliable data pipelines and repeatable workflows, especially when preparing lists for validation or drop-down menus. By default, it returns all unique values; you can adjust behavior with optional arguments and additional functions to tailor outputs to your data structure.
Core syntax and optional arguments
The syntax is =UNIQUE(array, [by_col], [exactly_once]). The array is the range you want to de-duplicate. by_col determines whether you compare by columns (TRUE) or by rows (FALSE). exactly_once returns items that appear exactly once when TRUE. If omitted, you’ll get all unique values. Combine with SORT for ordered results, or with FILTER to target specific records. Real-world usage: =SORT(UNIQUE(A2:A100)).
Spills, by_col, and exactly_once explained
UNIQUE spills automatically into neighboring cells, so ensure enough empty space to display results. By_col shifts the orientation: TRUE gives you unique columns; FALSE (default) yields unique rows. The exactly_once argument is useful when you need values that occur exactly once, which is helpful for detecting outliers or rare categories. If your data contains blanks, consider wrapping with FILTER to remove them, e.g., =FILTER(UNIQUE(A2:A100), LEN(A2:A100)>0).
Real-world workflows: deduplicating lists
In a typical data-cleaning flow, you start with a raw list that contains duplicates. Apply =UNIQUE to extract the distinct values, then optionally sort for readability: =SORT(UNIQUE(A2:A100)). You can also apply UNIQUE to multiple columns to get unique rows: =UNIQUE(A2:C100). When combining with other tools, your unique list can feed drop-down menus, validations, or pivot table inputs.
Combining UNIQUE with SORT and FILTER
To create a clean, ordered, and filtered dataset, nest functions: =SORT(UNIQUE(FILTER(A2:A100, B2:B100="North"))). This returns sorted, unique values only for a specific condition. If you want to return only values that occur once, use =UNIQUE(A2:A100,,TRUE). You can also use by_col for column-based uniqueness when your data is row-oriented.
Handling case sensitivity and data types
UNIQUE is case-insensitive by default in Excel, so "Apple" and "apple" may be treated as the same value. If you need case-sensitive results, apply a helper function like EXACT to standardize text first: =UNIQUE(IF(EXACT(A2:A100, LOWER(A2:A100)), A2:A100, LOWER(A2:A100))). For numbers and dates, ensure consistent data types to avoid unexpected results.
Performance considerations and best practices
Since UNIQUE relies on dynamic arrays, performance can slow with very large datasets. Keep data ranges as tight as possible and avoid whole-column references if you don’t need them. Use SORT and FILTER cautiously to prevent adding processing overhead. Document your formulas and consider creating named ranges for reusable data sources to improve readability and maintainability.
Common mistakes and troubleshooting
A common issue is missing spill ranges: Excel will warn that the spill range is blocked. Clear the area or move the formula to an empty space. Another pitfall is assuming older Excel versions support dynamic arrays; in that case you’ll need manual methods such as Advanced Filter or helper columns. Always test with a small sample before scaling.
Accessibility and auditing unique lists
Providing accessible, well-documented unique lists helps colleagues reuse data accurately. Add clear headers, labels, and notes about what the UNIQUE output represents. When sharing workbooks, include a short description of how the UNIQUE formula works and its dependencies on adjacent functions like SORT or FILTER.
Tools & Materials
- Computer with Excel 365 or Excel 2021+(Dynamic arrays supported; ensure your edition is up to date)
- Sample workbook with a known list(One column of text/numbers with duplicates)
- Internet access for reference examples(Optional for verifying syntax and best practices)
- Note-taking app or buffer(Capture tips and variants as you learn)
Steps
Estimated time: 20-30 minutes
- 1
Open your workbook and locate the data range
Open the workbook that will receive the unique values and locate the range you want to deduplicate. Ensure the data is in a single column or a well-defined block and that there are no mixed data types.
Tip: Keep data in a single column for simple spills. - 2
Position the spill area for the UNIQUE result
Select the cell where you want the unique list to appear. The UNIQUE function spills automatically into adjacent cells, so choose a location with enough empty space.
Tip: Check the spill area before typing the formula to avoid blocked ranges. - 3
Enter the basic UNIQUE formula
Type =UNIQUE(range) using your actual range, such as =UNIQUE(A2:A100). This returns all distinct values from the selected range.
Tip: Start with the simplest form to verify results. - 4
Add optional arguments for orientation
If you’re working with rows instead of columns, add the by_col argument: =UNIQUE(A2:D100, TRUE).
Tip: Experiment with by_col to see whether you want column-wise or row-wise uniqueness. - 5
Refine with exactly_once and helpers
To find values that occur exactly once, use =UNIQUE(A2:A100,,TRUE). If you need non-blank results, wrap with FILTER.
Tip: Combine with FILTER to remove blanks or unwanted values. - 6
Sort, filter, and validate
Combine with SORT or FILTER to clean and present your unique data: =SORT(UNIQUE(A2:A100)).
Tip: Use named ranges for readability. - 7
Review and document
Double-check the outputs against your source data and add comments or notes describing the formula logic for future users.
Tip: Documentation saves time for teammates.
People Also Ask
What is the UNIQUE function in Excel?
UNIQUE is a dynamic-array function that returns distinct values from a range or array. It spills the results automatically into adjacent cells and supports optional arguments to tailor output.
UNIQUE returns distinct values from a range and spills them automatically; it can be tailored with extra arguments.
Does UNIQUE work in older Excel versions?
UNIQUE relies on dynamic arrays available in newer Excel versions. In older versions, you can use alternatives like Advanced Filter or helper columns.
It uses dynamic arrays, so older versions may need alternative methods.
Can I combine UNIQUE with SORT?
Yes. Wrapping UNIQUE with SORT returns a sorted list of distinct values, for example =SORT(UNIQUE(A2:A100)).
You can sort unique results by wrapping it with SORT.
What does exactly_once do?
exactly_once is an optional argument that returns values that appear exactly one time when set to TRUE.
exactly_once gives you values that occur only once.
How can I avoid duplicates across multiple columns?
You can use UNIQUE with by_col = TRUE to evaluate uniqueness across columns or apply UNIQUE to a multi-column range to get unique rows.
Use by_col or apply UNIQUE to multiple columns to identify unique rows or columns.
What are common mistakes when using UNIQUE?
Common mistakes include assuming full-column ranges spill, not keeping enough empty space, and ignoring data types that affect results.
Watch for spill space and data type consistency.
Watch Video
The Essentials
- Use UNIQUE to extract distinct values quickly
- Combine with SORT for organized results
- Follow XLS Library's verdict: pair UNIQUE with SORT for clean dashboards
