The Excel UNIQUE function is a lookup and reference formula that returns a list of unique values from a list or range. This formula is one of the newest Dynamic Array functions to be released with Excel 2019. In this guide, we’re going to show you how to use the Excel UNIQUE function and also go over some tips and error handling methods.
Supported versions
- At the time of writing this article, Microsoft announced that this formula is currently only available to a number of select insider users. When it's ready, the feature is planned for release for Office 365 users.
Excel UNIQUE Function Syntax
Arguments
array |
The range or array you want to parse unique values from. |
[by_col] |
Optional. A Boolean value that specifyies the comparison direction. · By row = FALSE (default) · By column = TRUE |
[occurs_once] |
Optional. A Boolean value indicating whether occurrence number is important. · TRUE: list values that occur once · FALSE: list values regardless of the number of occurrences (default) |
Examples
Note that we're using named ranges in our sample formulas to make them easier to read. This is not required.
Example 1
Example 2
Example 3
Tips
- Currently, this formula is only available on Office 365 which comes with a subscription.
- The UNIQUE function can be used as an alternative to the Remove Duplicates feature, without modifying the actual data.
- For horizontal ranges like A1:F1, set the by_col argument to TRUE or 1. =UNIQUE(A1:F1,1)
- Use with the SORT function to create a sorted list of unique items.
Issues
#SPILL!
If there isn't enough space for adding the results below the formula, you will see a #SPILL! error. Excel marks the target range with dashed lines. Clear the contents of the cells in this range, and Excel will automatically update the results.
#CALC!
The UNIQUE function returns a #CALC! error if it can't generate an array. For example, if you use occurs_once = TRUE with an array with repeating values (e.g. {2,2,3,3,3,4,4,4}) you will get this error.