Excel UNIQUE Function

UNIQUE returns distinct rows or values from a range or array.

Use it to build dynamic lists of customers, categories, regions, IDs, or other values that should appear once in a summary or validation list.

1
Choose an array The source values to compare
2
Compare rows or columns Excel finds distinct entries
3
Spill unique results The list expands as needed

UNIQUE syntax & arguments

Syntax

=UNIQUE(array, [by_col], [exactly_once])
Required Optional
  1. 1

    array

    Required

    The range or array containing values to de-duplicate.

  2. 2

    by_col

    Optional

    Controls whether UNIQUE compares rows or columns:

    • FALSE — Compare rows: Returns distinct rows. This is the default.
    • TRUE — Compare columns: Returns distinct columns.
  3. 3

    exactly_once

    Optional

    Controls whether repeated values are kept once or removed entirely:

    • FALSE — Distinct values: Returns each distinct value once, even when it appears multiple times. This is the default.
    • TRUE — Values that appear once: Returns only values that appear exactly one time in the source array.

Example

=UNIQUE(A2:A20)

Return each distinct value from A2:A20 once.

UNIQUE caveats

UNIQUE creates dynamic arrays, so source consistency and spill behavior both matter.

  • It returns distinct values by default

    Repeated values are returned once unless exactly_once is set to TRUE.

  • Rows and columns are different modes

    Use by_col only when the unique items should be compared across columns instead of down rows.

  • Small text differences matter

    Extra spaces or inconsistent labels can make values appear unique even when they should represent the same thing.

  • The result spills into nearby cells

    UNIQUE may return many rows or columns. Blocked output cells can cause a #SPILL! error.

Need the unique list ordered? Wrap UNIQUE in SORT.

Intro UNIQUE practice problem

Solve the intro problem directly here, or open it on its own page.

Open full problem

Advanced UNIQUE practice problems

Use UNIQUE alongside other Excel functions in realistic, less-prescriptive challenges.