UNIQUE
Description
Returns a matrix whose rows are unique according to the specified keys. The function
returns only unique rows, based on the values in the specified columns. This
function is similar to DISTINCTROWS(), but UNIQUE() takes a single range and a set
of columns. UNIQUE is case-sensitive.
Syntax
UNIQUE(
range
,
col1
, [
col2
], ...)
- range: The matrix to extract unique rows from.
- col1: The name of a column to use as a key in determining whether a row is unique.
- col2: The name of a column to use as a key in determining whether a row is unique.
Example
This is the original spreadsheet:
A | B | C | D | E | |
|---|---|---|---|---|---|
1 | Name | Grade | |||
2 | Joe | 85 | |||
3 | Alice | 92 | |||
4 | Joe | 90 |
The result of =UNIQUE(A1:B4,"Name") is:
Name | Grade |
|---|---|
Joe | 85 |
Alice | 92 |
Notes
- UNIQUE() is similar to DISTINCTROWS(). DISTINCTROWS() uses all the values in a row to determine whether the row is different from other rows, but UNIQUE() uses only the values in the specified columns. UNIQUE() filters therangeso that it returns only unique rows based on the values in the specified columns. The first row it considers unique is the one it returns; it doesn't return subsequent duplicate rows.
- This function is intended for use in array formulas.
Related Functions
DISTINCTROWS