ReferenceFunctionsLookup Functions
UNIQUE
UNIQUE: Returns distinct rows or columns from a range.
Summary
UNIQUE preserves first-occurrence order and can optionally return only values that appear once.
Remarks
- Defaults:
by_col=FALSE,exactly_once=FALSE. - With
by_col=FALSE, uniqueness is evaluated by full rows. - With
by_col=TRUE, uniqueness is evaluated by full columns. - With
exactly_once=TRUE, only entries with frequency 1 are returned. - Result spills as an array.
Examples
Unique values by row
Grid
| Cell | Value | |
|---|---|---|
Formula
=
Result
Not evaluated yet.
Expected
[["A"],["B"],["C"]]
Only values that appear once
Grid
| Cell | Value | |
|---|---|---|
Formula
=
Result
Not evaluated yet.
Expected
[[2],[3]]
Related functions
FAQ
What does exactly_once=TRUE change?
Instead of returning first occurrences, UNIQUE returns only rows or columns whose full key appears exactly one time.
How does by_col affect uniqueness checks?
by_col=FALSE compares entire rows, while by_col=TRUE compares entire columns and spills unique columns.
Runtime metadata
Category
Lookup
Signature
UNIQUE(arg1: Range (Range), arg2?: Logical, arg3?…: Logical)Arity
min 1, max variadic
Arguments
arg1by-refRange · Range
arg2optionaldefaultLogical · Scalar · coercion Logical
arg3optionaldefaultLogical · Scalar · coercion Logical
Caps
PURE
Source