How to Remove Duplicates in Google Sheets
By MagicTextTools Team · November 28, 2026
Why Duplicate Rows Creep In
A list copied from two sources, a form that was submitted twice, or a paste that landed in the wrong place will leave the same row in your sheet two or three times. Learning how to remove duplicates in google sheets takes less than a minute, because Sheets already has a cleanup tool for it, and two formulas cover the cases the tool cannot.
The four methods below do different jobs. The built-in tool deletes copies in place. UNIQUE builds a clean copy and leaves the original alone. A COUNTIF helper column lets you inspect each duplicate before you delete it. QUERY lists every value once, with a count beside it. Pick the method that matches what you want to keep.
Method 1: Use the Built-In Remove Duplicates Tool
This is the fastest way, and the one most people need. It deletes the extra copies right where they are, and then tells you how many it removed.
- Select the range that holds your list, including every column that belongs to it.
- Open the Data menu at the top.
- Click Data cleanup, then Remove duplicates.
- Tick "Data has header row" if your first row holds column names, so Sheets does not treat the header as a value.
- Tick the columns that define a duplicate. A row counts as a duplicate only when every ticked column matches.
- Click Remove duplicates. Sheets reports how many duplicate rows it removed and how many unique rows are left.
Select the full row range before you start. If you select one column only, Sheets checks that column alone, and the other columns in those rows stay behind, which can split your data apart. If the count it reports looks wrong, press Ctrl+Z (or Cmd+Z on a Mac) right away to undo it, fix the selection, and run it again.
Method 2: The UNIQUE Function
Use UNIQUE when you want a clean copy and want the original list to stay untouched. The formula builds the deduped list in a new place, and it updates itself whenever the source changes.
- Click an empty cell where the clean list should start.
- Type the formula for one column of values, for example =UNIQUE(A2:A100).
- Press Enter. Sheets spills the unique values down from that cell.
- To dedupe whole rows across several columns, give the full range instead, for example =UNIQUE(A2:C100).
- To sort the clean list at the same time, wrap it: =SORT(UNIQUE(A2:A100)).
Keep the cells below and to the right of the formula empty, because the result needs room to spill. If anything sits in the way, Sheets shows a #REF! error instead of the list. Clear those cells and the list appears. The result is a live view, not a pasted copy, so editing a value in the source updates the clean list at once.
Method 3: Find Duplicates First With COUNTIF
Sometimes you should look at the duplicates before you delete them, for example when a repeated name might be two different people. A helper column marks every repeat, then a filter shows only the marked rows.
- In the first empty column beside your list, type this formula in row 2: =COUNTIF($A$2:$A2,A2).
- Copy it down the whole list. The first time a value appears it shows 1. Every repeat shows 2, 3, and so on.
- Select the helper column, then open Data and click Create a filter.
- Open the filter on the helper column and tick only the numbers above 1.
- Check the rows that appear, delete the ones that are true copies, then turn the filter off.
The dollar signs in $A$2 lock the start of the range while the end moves down with each row, so each formula counts only the values above it plus the current one. When you are done, delete the helper column. If you want the repeats highlighted instead of filtered, use the same idea in conditional formatting: select the range, open Format, then Conditional formatting, and use the custom formula =COUNTIF($A$2:$A$100,A2)>1.
Method 4: List Each Value Once With QUERY
QUERY is the right tool when you also want to know how often each value appears. It returns one row per value, with a count beside it.
- Click an empty cell where the result should start.
- Type this formula: =QUERY(A2:A100,"SELECT A, COUNT(A) GROUP BY A LABEL A 'Value', COUNT(A) 'Times'").
- Press Enter. You get each unique value once, with the number of times it appears.
- If your range has a header row, add a third argument of 1, like this: =QUERY(A1:A100,"SELECT A, COUNT(A) GROUP BY A LABEL A 'Value', COUNT(A) 'Times'",1).
- If blank cells bother you, add a filter to the query: =QUERY(A2:A100,"SELECT A, COUNT(A) WHERE A IS NOT NULL GROUP BY A LABEL A 'Value', COUNT(A) 'Times'").
The result is a report, not a cleaned copy of your sheet, so use it to check the shape of your data before you run the built-in tool, or to paste a tidy summary into another sheet. Like UNIQUE, it stays live: add a row to the source and the counts update.
Which Method Should You Pick
- Need the copies gone in seconds, in place: the built-in Remove duplicates tool.
- Need a clean copy while the original stays as it is: UNIQUE.
- Need to inspect each repeat before deleting it: the COUNTIF helper column.
- Need each value once, with a count beside it: QUERY.
If you remember one rule, make it this: select the whole row range before you dedupe. A duplicate is a full row, not one cell, and a one-column selection is the most common way to damage a list.
Common Mistakes
Selecting one column instead of the full range. The built-in tool only compares the columns you select. Select the whole table, or the untouched columns will no longer line up with the cleaned one.
Forgetting the header row checkbox. If the first row holds names like Name or Email and the box is unticked, Sheets treats that header as a value. Tick "Data has header row" whenever your range starts with labels.
Letting UNIQUE spill into filled cells. The formula needs empty cells below it. If it shows #REF!, look for a value, a space, or a formula in the spill area and clear it.
Treating lookalikes as duplicates. "Apple" and "apple", or "Sara " with a trailing space, are different values to a formula. Standardise case with UPPER or LOWER and clean spaces with TRIM before you compare, or the copies will survive.
Deleting before checking what a repeat is. Two rows with the same name can be two different customers. When the data matters, use the COUNTIF method and look at the repeats first.
Frequently Asked Questions
Does the built-in tool keep the first copy?
Yes. It keeps the first time a row appears and removes the later copies. The order of your remaining rows does not change.
Can I undo it after removing duplicates?
Yes, right after. Press Ctrl+Z, or Cmd+Z on a Mac, to put the removed rows back. Do it before you make other edits, so the undo step is the removal and not something else.
Does UNIQUE update when I edit the source?
Yes. UNIQUE is a live formula, so changing, adding, or deleting a value in the source range updates the clean list at once. The built-in tool is a one-time action and does not track later changes.
Can I check duplicates across several columns at once?
Yes. In the built-in tool, tick every column that must match for a row to count as a duplicate. With UNIQUE, pass the full range, for example =UNIQUE(A2:C100), and it compares whole rows.
What happens to blank rows?
The built-in tool leaves blank rows alone. UNIQUE returns a single blank row for them, so filter blanks out first or add WHERE A IS NOT NULL to a QUERY if a blank line in the result bothers you.
Faster Alternative: Remove Duplicates Online
If your list is plain text rather than a sheet, our free online Remove Duplicate Lines tool dedupes it in the browser, with no signup and nothing sent to a server. If your duplicates live in Excel instead, see our guide on removing duplicates in Excel.