Google Sheets UNIQUE Function: How It Works

How-to basics · Updated November 23, 2026

The Google Sheets UNIQUE function returns the unique rows from a given range, removing duplicates while keeping the order in which each distinct row first appears. Its syntax is simple: UNIQUE(range) — for example, =UNIQUE(A2:A100) extracts every distinct value from that column.

What UNIQUE Does (and Doesn’t Do)

UNIQUE is a dynamic array function in Google Sheets. When you enter it in a cell, it automatically “spills” results into the cells below (and to the right if the source range has multiple columns). Unlike a static filter or a manual “Remove Duplicates” command, UNIQUE recalculates whenever the source data changes, so your list of unique items stays current without extra steps.

Key behaviors to know:

  • It compares entire rows, not individual cells. If your range spans two columns, a row is considered a duplicate only if all its cells match another row.
  • It treats text case-sensitively? No — by default, UNIQUE is case-sensitive. “Apple” and “apple” are considered different values. To ignore case, you need to normalize the data first (e.g., with LOWER).
  • It ignores completely empty rows. If an entire row is blank, it is not returned.
  • It returns a vertical list. If you want a horizontal list, you can wrap it with TRANSPOSE.

How to Use UNIQUE in a Real Sheet

Imagine you have a list of customer names in column A (A2:A50) with duplicates. To get a clean list of every customer, click any empty cell and type:

=UNIQUE(A2:A50)

Press Enter. The unique names appear starting in that cell, flowing downward. If you later add a new name to A51, the UNIQUE result updates automatically (provided the range includes that row — you can use an open-ended range like A2:A to include future entries in the same column).

For a multi-column example, suppose columns A and B contain product and region. To list every unique product-region combination, use:

=UNIQUE(A2:B100)

Each unique pair appears as a row. This is extremely useful for creating dropdown lists, pivot table source data, or just cleaning raw exports.

Combining UNIQUE with Other Functions

UNIQUE is often paired with SORT and FILTER to build dynamic reports. For example, to get a sorted list of unique products from column A:

=SORT(UNIQUE(A2:A100))

To get unique customers only from a specific region (where region is in column B):

=UNIQUE(FILTER(A2:A100, B2:B100="West"))

You can also count unique values with COUNTA:

=COUNTA(UNIQUE(A2:A100))

This returns the number of distinct entries. Note that if your data contains blank cells, COUNTA will count them as a unique blank; use COUNTA(UNIQUE(FILTER(A2:A100, A2:A100<>""))) to exclude blanks.

UNIQUE vs. Remove Duplicates Menu

Google Sheets also has a manual command: Data > Data cleanup > Remove duplicates. That permanently deletes duplicate rows from your data. UNIQUE, on the other hand, leaves your original data untouched and shows the unique list elsewhere. Which should you use?

  • Use UNIQUE when you want a live, formula-driven list that updates automatically.
  • Use Remove duplicates when you want to permanently clean a dataset and no longer need the original duplicates.
  • Use UNIQUE when you need to preserve the original order of first appearance; Remove duplicates also preserves order, but it modifies the data.

There is also a third option: the UNIQUE function can be combined with ARRAYFORMULA if you need to process an entire column, but that is rarely necessary because UNIQUE already handles arrays natively.

Common Errors and How to Fix Them

Most issues with UNIQUE come from a few misunderstandings:

  • #N/A error — This appears when the result would overwrite existing cells. For example, if you type =UNIQUE(A2:A10) in B2 and B3 already has data, the formula cannot spill. Clear the cells below the formula, or move the formula to an empty area.
  • Wrong number of rows/columns — If your source range has 3 columns, UNIQUE will return 3 columns. If you only wanted one column, adjust the range.
  • Case sensitivity surprises — If you need case-insensitive uniqueness, use =UNIQUE(ARRAYFORMULA(LOWER(A2:A100))) or =UNIQUE(LOWER(A2:A100)) (in newer Sheets, LOWER works on arrays directly).
  • Trailing spaces — UNIQUE treats “Apple” and “Apple ” as different. Use TRIM to clean data first: =UNIQUE(TRIM(A2:A100)).

UNIQUE in Excel vs. Google Sheets

Excel has its own UNIQUE function (available in Excel 365 and Excel 2021) with the same basic syntax: =UNIQUE(array). However, there are notable differences:

  • Excel’s UNIQUE has an optional third argument exactly_once (TRUE returns values that appear only once; FALSE or omitted returns all distinct values). Google Sheets’ UNIQUE does not have that argument — you’d need to use FILTER and COUNTIF to achieve the same.
  • In Excel, you must be in a version that supports dynamic arrays; otherwise you get a #SPILL! error. Google Sheets always supports dynamic arrays.
  • Excel’s UNIQUE is case-insensitive? Actually, Excel’s UNIQUE is also case-sensitive by default. Both treat “A” and “a” as different.

If you are moving between the two, the core behavior is identical; the main difference is the optional exactly_once parameter in Excel.

Performance and Large Datasets

UNIQUE is efficient, but like any array formula, it recalculates when any cell in the source range changes. For very large datasets (tens of thousands of rows), this can slow down your sheet. Tips to keep it fast:

  • Limit the range to the actual data, not entire columns. Use A2:A1000 instead of A2:A if you know the size.
  • Avoid wrapping UNIQUE in heavy functions like ARRAYFORMULA unnecessarily.
  • If you need a static unique list, consider using Data > Data cleanup > Remove duplicates once, then paste values.
  • Use UNIQUE in a separate tab to keep the main data sheet uncluttered.

Frequently Asked Questions

Does UNIQUE ignore blank cells?

Yes, completely blank rows are ignored. However, if a row has some text and some blanks, it is treated as a valid row. For example, a row with “Apple” in column A and blank in column B is considered a unique row.

Can I use UNIQUE with a condition?

Not directly. UNIQUE only takes a range. To get unique values that meet a condition, first filter the range with FILTER, then wrap it in UNIQUE: =UNIQUE(FILTER(A2:A100, B2:B100="Yes")).

How do I get a list of values that appear only once?

Google Sheets doesn’t have a direct “exactly once” argument like Excel. Use this formula: =FILTER(A2:A100, COUNTIF(A2:A100, A2:A100)=1). This returns values whose count in the range is exactly 1.

Why is my UNIQUE formula showing a #REF! error?

That error usually means the formula’s output would overwrite existing data. For example, if you put the formula in cell C2 and C3 already has a value, the spill range can’t expand. Clear the cells below and try again, or move the formula to an empty column.

Can I use UNIQUE to remove duplicates from multiple columns at once?

Yes. If you select a range with multiple columns, UNIQUE will consider the entire row (all columns) when determining duplicates. Rows are returned as they first appear.

Is UNIQUE case-sensitive?

Yes, by default both Google Sheets and Excel treat “Apple” and “apple” as different. To make it case-insensitive, convert everything to lowercase first: =UNIQUE(LOWER(A2:A100)).

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.