1. Home
  2. Functions
  3. Array
  4. UNIQUE

UNIQUE function

Returns the unique rows (or columns) of a range or array.

Syntax

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

Arguments

ArgumentRequiredDescription
arrayRequiredThe range or array
by_colOptionalFALSE (default) compares rows, TRUE compares columns
exactly_onceOptionalTRUE returns only the values that appear exactly once

How to use UNIQUE

When UNIQUE returns more than one value, the result spills into the cells below and to the right. Keep those cells empty, or you get #SPILL!.

UNIQUE takes 1 required argument and 2 optional arguments. Type =UNIQUE( in a cell and SheetsBat shows the arguments as you go. Optional arguments are shown in square brackets; leave them out to use their default.

Examples

Each result below was calculated by the SheetsBat formula engine.

=UNIQUE({1;2;1;3})Result 3 by 1 array
Spilled result
A
11
22
33
=UNIQUE({"a";"A";"b"})Result 2 by 1 array
Spilled result
A
1a
2b
=UNIQUE({1;2;1}, FALSE, TRUE)Result 2

Every formula, right in your browser

SheetsBat calculates 536 functions, with charts, pivot tables and live collaboration. Free to start.