=UNIQUE(array,[by_col],[exactly_once])
The UNIQUE function has the following arguments:
|
Argument |
Description |
|---|---|
|
array Required |
The range or array from which to return unique rows or columns |
|
[by_col] Optional |
The by_col argument is a logical value indicating how to compare. TRUE will compare columns against each other and return the unique columns FALSE (or omitted) will compare rows against each other and return the unique rows |
|
[exactly_once] Optional |
The exactly_once argument is a logical value that will return rows or columns that occur exactly once in the range or array. This is the database concept of unique. TRUE will return all distinct rows or columns that occur exactly once from the range or array FALSE (or omitted) will return all distinct rows or columns from the range or array |
Notes:
-
An array can be thought of as a row or column of values, or a combination of rows and columns of values. In the examples above, the arrays for our UNIQUE formulas are range D2:D11, and D2:D17 respectively.
-
The UNIQUE function will return an array, which will spill if it’s the final result of a formula. This means that Excel will dynamically create the appropriate sized array range when you press ENTER. If your supporting data is in an Excel Table, then the array will automatically resize as you add or remove data from your array range if you’re using Structured References. For more details, see this article on Spilled Array Behavior.
-
Excel has limited support for dynamic arrays between workbooks, and this scenario is only supported when both workbooks are open. If you close the source workbook, any linked dynamic array formulas will return a #REF! error when they are refreshed.
