UNIQUE vs Remove Duplicates in Google Sheets: Live or Static, Letter Case, Spaces, Columns and Headers (2026)
Google Sheets gives you two built-in ways to get rid of duplicates: the UNIQUE function and the Data › Data cleanup › Remove duplicates command. They look interchangeable, but they disagree more often than you would expect: one is a live formula and the other deletes rows, one cares about letter case and the other doesn’t, and they don’t even compare the same columns by default. This guide puts them side by side on one small example, shows exactly where the results differ, and tells you which one to use for which job.
The short answer
- Use UNIQUE when you want a clean list next to your data that keeps updating as rows are added, such as a list of customers for a drop-down or a report tab, and the original must stay untouched.
- Use Remove duplicates when the extra rows are genuine copies and you want them gone from the data itself, once, for example before you send a mailing or import a list somewhere else.
- If the duplicate rows carry different information (another order amount, a newer phone number), use neither yet: see merge duplicate rows or keep the latest row per key.
Side by side
| UNIQUE function | Data cleanup › Remove duplicates | |
|---|---|---|
| What it does | Writes the distinct rows somewhere else | Deletes the repeated rows from the selection |
| Original data | Untouched | Changed (undo or version history to go back) |
| New rows later | Picked up automatically (open range like A2:C) | Not checked; run it again |
| Letter case | Matters: Ana@x.com ≠ ana@x.com | Ignored: they are duplicates |
| Trailing / extra spaces | Matter | Matter (trim first) |
| Formatting and formulas | Help says format numbers the same way, or look-alike values can come back twice | Ignored: same value with different formatting or a formula counts as a duplicate |
| Columns compared | Every column in the range | Only the columns you tick (the whole row is still deleted) |
| Which row survives | The first appearance, in original order | The first row of each group |
| Header row | Start the range below it, or it becomes part of the result | Tick “Data has header row” |
| Values that appear once only | UNIQUE(range, FALSE, TRUE) | Not available |
The behavior of Remove duplicates comes from Google’s help on removing duplicates and trimming whitespace (“Cells with identical values but different letter cases, formatting, or formulas are considered to be duplicates”); the UNIQUE details are from the UNIQUE help page and the tests below.
The example
A tab called Signups with a header row: Email in A, Name in B, Date in C.
| Row | A: Email | B: Name | C: Date |
|---|---|---|---|
| 2 | ana@x.com | Ana | 11/03 |
| 3 | bo@x.com | Bo | 11/04 |
| 4 | Ana@x.com | Ana | 11/03 |
| 5 | cy@x.com | Cy | 11/05 |
| 6 | bo@x.com | Bo | 11/04 |
| 7 | ana@x.com␣ | Ana | 11/06 |
| 8 | dee@x.com | Dee | 11/07 |
| 9 | bo@x.com | Bob | 11/08 |
Row 6 is an exact copy of row 3. Row 4 differs from row 2 only in the capital A. Row 7 has a trailing space after the email (shown as ␣). Row 9 is Bo again with a newer date and a different name. There are four real people.
| What you run | Rows left | Why |
|---|---|---|
=UNIQUE(A2:C9) | 7 | Only row 6 is an exact copy; Ana@x.com is “different” because of the capital |
| Remove duplicates, all 3 columns ticked | 6 | Row 6 and row 4 go (case ignored); the space and Bob rows stay |
=UNIQUE(A2:A9) (emails only) | 6 emails | ana, bo, Ana, cy, ana␣, dee |
| Remove duplicates, only Email ticked | 5 | Rows 4, 6 and 9 go; the trailing-space row stays |
| Trim whitespace, then Remove duplicates on Email | 4 | One row per person; the first row of each is kept |
| LOWER/TRIM key formula (below) | 4 | Same four rows, source untouched |
Two things to notice. First, the counts disagree before anyone has made a mistake: the tools simply define “duplicate” differently. Second, keeping the first row isn’t always right: Remove duplicates on Email dropped row 9, Bob’s newer entry. If the latest row should win, sort first or use keep the latest row per key.
UNIQUE in practice
In an empty area, or better on another tab, enter:
=UNIQUE(FILTER(Signups!A2:C, Signups!A2:A<>""))
UNIQUE returns each distinct row once, in the order it first appears. The FILTER is there because an open range like A2:C includes the empty rows below your data, and UNIQUE would otherwise return one blank row at the end. =UNIQUE(Signups!A2:C) on its own works too if you don’t mind that.
- It is live. Add a row to Signups and the result updates. That is the main reason to choose it.
- You can’t edit the result. The cells are filled by one formula. Typing in them, or having something already in the cells it needs, gives a #REF! error (“Array result was not expanded because it would overwrite data”). Leave room below and to the right.
- It compares every column you give it.
UNIQUE(A2:C)removes a row only when email, name and date all repeat. To dedupe on one column but return whole rows, use the key formula below. - Exact text. Letter case and stray spaces make values different. Google’s help also asks you to format numbers the same way (percentages as percentages, currency as currency) when look-alike rows come back twice.
- Only-once values.
=UNIQUE(A2:A9, FALSE, TRUE)lists values that occur exactly once. On the raw example it returns five emails, three of which are really Ana, because the case and space variants each occur once. Clean the key first.
Ignore case and spaces, keep the original spelling
UNIQUE(LOWER(A2:A)) inside ARRAYFORMULA ignores case, but it also lowercases the output and works on one column. To match the way Remove duplicates thinks, keep whole rows and leave the source as typed:
=ARRAYFORMULA(LET(d, Signups!A2:C, k, LOWER(TRIM(Signups!A2:A)), FILTER(d, k<>"", XMATCH(k, k)=SEQUENCE(ROWS(k)))))
k is the lowercased, trimmed email of each row. XMATCH(k, k) gives the position where each email first appears, and SEQUENCE(ROWS(k)) is each row’s own position; they are equal only on the first occurrence, so FILTER keeps the first row per person. On the example it returns rows 2, 3, 5 and 8, the same four rows as Trim whitespace plus Remove duplicates on Email, without changing Signups. To put the header on top:
=VSTACK(Signups!A1:C1, ARRAYFORMULA(LET(d, Signups!A2:C, k, LOWER(TRIM(Signups!A2:A)), FILTER(d, k<>"", XMATCH(k, k)=SEQUENCE(ROWS(k))))))
Functions used: UNIQUE, FILTER, LET, XMATCH, SEQUENCE, TRIM, VSTACK and ARRAYFORMULA. For more on case, spaces, Gmail dots and phone formats, see duplicates that don’t match exactly.
Making a UNIQUE result static
Select the result, copy it, and choose Edit › Paste special › Values only (paste special), preferably on a new tab. You now have plain values that no longer follow the source. Doing this on top of the formula itself replaces it, which is fine once you are sure.
Remove duplicates in practice
- Duplicate the tab first (right-click the tab › Duplicate). The command changes your data.
- Select the whole table, all of its columns, including the header row. If you click a single cell inside the data, Sheets uses the whole range around it.
- Choose Data › Data cleanup › Remove duplicates.
- Tick Data has header row so the header isn’t treated as data and the column list shows your header names.
- Under columns to analyze, tick only the columns that define a duplicate, e.g. just Email. Rows that match on those columns are deleted whole, even if other columns differ.
- Click Remove duplicates. Sheets reports how many duplicate rows it removed and how many unique rows remain.
- Trim first. Run Data › Data cleanup › Trim whitespace on the key column. It removes leading, trailing and repeated spaces, but not non-breaking spaces (common in data pasted from web pages).
- Don’t select one column of a table. The command only touches the cells you selected. If you select just column A, emails shift up while names and dates stay put; in the example cy@x.com would end up next to 11/03. Select every column, then untick the ones not to compare.
- Case is ignored. Usually what you want for emails, but not for case-sensitive codes such as some product SKUs or IDs. For those, use UNIQUE, which keeps them apart.
- One-time only. Rows added tomorrow are not checked. If duplicates keep arriving from a form or an import, use a formula tab, or stop them at entry with data validation.
- Undo. Edit › Undo right away, or File › Version history later.
Which one should I use?
| Situation | Use |
|---|---|
| A clean list for a drop-down, dashboard or report that stays current | UNIQUE (or the key formula) |
| A one-off cleanup before a mailing or an import | Remove duplicates, after Trim whitespace |
| Codes where Abc1 and ABC1 are different things | UNIQUE |
| Emails or names where case shouldn’t matter, source must stay | LOWER/TRIM key formula |
| You want to see the duplicates before anything is deleted | highlight them or count them first |
| Duplicates hold different amounts or notes | Merge the rows, don’t delete |
| Two lists or tabs to combine | UNIQUE with VSTACK |
Pitfalls
- “UNIQUE didn’t remove my duplicates.” They differ in case, a trailing or non-breaking space, or number formatting. Check with
=LEN(A2)and=EXACT(A2, A4). - “Remove duplicates deleted too much.” Only some columns were ticked, so rows sharing one value were treated as duplicates even though the other columns differed.
- “The counts don’t match.” Case, ticked columns and the blank row from an open range explain almost every difference; see the table above, and counting duplicates for why the numbers disagree.
- Header in the formula.
UNIQUE(A1:C)keeps the header on top only because it appears first; wrap it in SORT or LOWER and the header gets sorted or lowercased with the data. Start at row 2 and add the header with VSTACK or a typed row. - Sorting a UNIQUE result. Put the sort in the formula,
=SORT(UNIQUE(FILTER(Signups!A2:C, Signups!A2:A<>"")), 1, TRUE), rather than sorting the result cells.
FAQ
What is the difference between UNIQUE and Remove duplicates in Google Sheets?
UNIQUE is a formula: it writes a de-duplicated copy somewhere else, leaves the source alone and updates when the source changes. Data › Data cleanup › Remove duplicates is a one-time command that deletes the repeated rows from the data itself. UNIQUE compares text exactly, so letter case matters; Remove duplicates treats values that differ only in letter case as duplicates.
Is UNIQUE case-sensitive in Google Sheets?
Yes. UNIQUE keeps Ana@x.com and ana@x.com as two values. To ignore case, compare a LOWER(TRIM()) key with XMATCH and FILTER the original rows, which keeps the first spelling as typed, or use UNIQUE(LOWER(range)) inside ARRAYFORMULA if a lowercased result is fine.
Does Remove duplicates ignore extra spaces?
No. Google’s help says values that differ in letter case, formatting or formulas count as duplicates, but a trailing space still makes two values different. Run Data › Data cleanup › Trim whitespace on the column first; it does not remove non-breaking spaces.
Why do UNIQUE and Remove duplicates give different counts?
Usually for one of three reasons: Remove duplicates ignores letter case and UNIQUE doesn’t; Remove duplicates compares only the columns you tick while UNIQUE compares every column of the range; or an open range like A2:A makes UNIQUE return one extra blank row.
How do I use UNIQUE on one column but keep the whole row?
UNIQUE always compares every column you give it. To keep one row per email with all its columns, use FILTER with an XMATCH key: =ARRAYFORMULA(LET(d, Signups!A2:C, k, LOWER(TRIM(Signups!A2:A)), FILTER(d, k<>"", XMATCH(k, k)=SEQUENCE(ROWS(k))))). It keeps the first row of each email, like Remove duplicates.
How do I make UNIQUE results static?
Select the result, copy it, and use Edit › Paste special › Values only, ideally on a new tab. After that the list no longer updates when the source changes.
Can I undo Remove duplicates?
Right away, yes: Edit › Undo (Ctrl+Z, or ⌘+Z on a Mac). Later, use File › Version history. Duplicating the tab before you run it is the simplest safety net.
Install free from Google Workspace MarketplaceSee SheetDupes
Want to test it first? Try it on sample data (makes a copy of a 12-row example sheet in your Drive).
Related guides
- How to Find and Remove Duplicates in Google Sheets: Highlight, Count, Delete and Keep the Original (2026)
- How to Highlight Duplicates in Google Sheets: Conditional Formatting Formulas for One Column, Whole Rows, Repeats Only and Two Sheets (2026)
- How to Compare Two Columns or Two Sheets in Google Sheets to Find Matches and Duplicates (2026)
- Duplicates That Don’t Match Exactly in Google Sheets: Case, Extra Spaces, Gmail Dots, Phone Formats and Typos (2026)
- How to Remove Duplicates in Google Sheets but Keep the Latest, First or Highest Row per Key (2026)
- How to Prevent Duplicate Entries in Google Sheets: Data Validation Rules, Warnings and a Small Script (2026)
- How to Count Duplicates in Google Sheets: per Value, Extra Rows, Unique Counts and Why the Numbers Disagree (2026)
- How to Combine Two Lists or Several Tabs in Google Sheets Without Duplicates: VSTACK, UNIQUE, One Row per Key and Other Files (2026)
- How to Merge Duplicate Rows in Google Sheets: Sum the Numbers, Join the Notes and Fill the Blanks (2026)
- How to Remove Duplicates Within a Cell in Google Sheets: Comma-Separated Lists, Tags, Line Breaks and Letter Case (2026)
- How to Show Only the Duplicates in Google Sheets: Filter Duplicate Rows, List Repeated Values and Find Rows That Appear Once (2026)
- How to Find Duplicates Across Multiple Columns in Google Sheets: Rows That Match on Two or More Columns, and Values Repeated Anywhere in a Range (2026)
- How to Remove Duplicates Automatically in Google Sheets: Apps Script on a Daily Timer, on Form Submit or From a Menu (2026)
- How to Find Duplicates in Google Sheets but Ignore Blank Cells: Highlight, Count, List and Remove Without Empty Rows Getting in the Way (2026)
- How to Find Duplicate Transactions in Google Sheets: Double-Imported Rows, Invoices Paid Twice and Same-Amount Charges Within a Few Days (2026)
- How to Format Phone Numbers in Google Sheets: Strip Dashes and Spaces, Show (555) 010-1234, Handle +1 and Extensions, Then Find Duplicate Contacts (2026)
- How to Change Text Case in Google Sheets: UPPERCASE, lowercase, Proper Case Names, Sentence Case and Duplicates That Differ Only in Case (2026)