Formualizer Docs

UNIQUE

Returns distinct rows or columns from a range.

UNIQUE preserves first-occurrence order and can optionally return only values that appear once.

The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.

Syntax

=UNIQUE(array, [by_col], [exactly_once])

Arguments

ArgumentTypeRequiredDefault
arrayrange (range)Required—
by_collogicalOptionalfalse
exactly_oncelogicalOptionalfalse

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

Return one entry for each distinct region.

Formula =UNIQUE({"East";"West";"East"})

Expected result {"East"; "West"}

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Return only names that occur exactly once.

Formula =UNIQUE({"East";"West";"East"},FALSE,TRUE)

Expected result West

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

A single entry is its own unique result.

Formula =UNIQUE({"East"})

Expected result East

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

A division-by-zero error propagates from the input.

Formula =UNIQUE(1/0)

Expected result #DIV/0!

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Unique values by row

Formula =UNIQUE(A1:A4)

Input cells
A
1"A"
2"A"
3"B"
4"C"

Expected result {"A"; "B"; "C"}

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Only values that appear once

Formula =UNIQUE(A1:A4,FALSE,TRUE)

Input cells
A
11
21
32
43

Expected result {2; 3}

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

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.

Implementation

Engine source

On this page