Lookup
UNIQUE
Definition
UNIQUE returns the distinct values from a range, in the order they first appear.
Syntax
=UNIQUE(array)
Arguments
| Argument | Meaning |
|---|---|
array |
The cells to read, such as A2:A4. |
Worked example
A mill lists grain types with repeats. Types are in A2:A4.
| A: Type |
|---|
| rye |
| rye |
| oats |
Formula: =INDEX(UNIQUE(A2:A4),1)
Result: rye. rye is the first distinct label, and INDEX keeps the cell to that one value.
Practice
Cells A2:A4 hold 3, 3, and 1. In B2, write a formula that returns the first unique value from that range.
- In B2, write an INDEX and UNIQUE formula that returns the first unique value in A2:A4.
- B2 should show the first unique value in A2:A4.
Step 1 of 2
Enter =INDEX(UNIQUE(A2:A4),1) in B2.
The unique values of 3, 3, and 1 start with 3.
Formulas here use English function names, such as SUM, and a period as the decimal separator, in every language.
Loading the sheet…
B2 uses UNIQUE.
B2 now shows 3.
Related functions
FILTER can keep rows that pass a test. INDEX picks one item from the unique list.
Common mistake
Expecting UNIQUE to ignore extra spaces: "rye" and "rye " count as two values.