Google Sheets function

UNIQUE function in Google Sheets

UNIQUE in Google Sheets returns unique rows from a source range and keeps them in the order where they first appeared. Optional settings can compare columns instead of rows or return only entries that appear exactly once. Hidden trailing spaces can make apparent duplicates remain separate.

Source: Google Docs Editors HelpLast verified Nov 5, 2026

Syntax

=UNIQUE(range, [by_column], [exactly_once])

Arguments

ArgumentRequiredWhat it means
rangeYesThe source data to filter for unique entries.
by_columnNoTRUE to compare columns instead of rows. The default is FALSE.
exactly_onceNoTRUE to return only entries with no duplicates. The default is FALSE.

Examples

List each team once

A
1Team
2Ops
3Sales
4Ops
5Support
=UNIQUE(A2:A5)

Result: Ops; Sales; Support

UNIQUE keeps the first Ops entry and discards the duplicate.

Common mistakes

Assuming two cells are identical when one contains trailing spaces.

Remove hidden spaces before checking for unique entries.

Expecting the result to be alphabetically sorted.

UNIQUE preserves first-appearance order. Wrap it in SORT when you need ordering.