English
/

How to Remove Duplicates in Excel and Google Sheets Safely

Last edited Nov 6, 2026 · 4 min read

To remove duplicates in Excel, select the data, choose Data > Remove Duplicates, tick the columns that must match, and select OK. Excel keeps the first occurrence and deletes later matching records within the selected range, not entire worksheet rows outside that range. In Google Sheets, select the range and choose Data > Data cleanup > Remove duplicates. Copy the original data first: Microsoft warns that removing duplicates permanently deletes them.

On this page▾
  1. Excel vs Google Sheets at a glance
  2. Remove duplicates in Excel
  3. Which columns should you tick?
  4. How to choose which duplicate Excel keeps
  5. Why two rows that look the same were not removed
  6. Remove Duplicates will not run
  7. Remove duplicates in Google Sheets
  8. Find duplicates first, delete second
  9. A safe five-step routine
  10. Remove duplicates FAQ

Excel vs Google Sheets at a glance

Question Excel Google Sheets
Menu Data > Data Tools > Remove Duplicates Data > Data cleanup > Remove duplicates
Which row stays The first occurrence; later matches are deleted Not stated in Google's help page
What decides a match Only the columns you tick; all columns of the matching record within the selected range are removed The columns you include
Text case Not stated in Microsoft's help pages "Smith" and "SMITH" count as duplicates
Formatting What the cell displays: 3/8/2006 and Mar 8, 2006 are different Different formatting still counts as a duplicate
Undo Undo (Ctrl+Z) right after Not covered in Google's help page; keep a copy
Keep the original Advanced Filter > Unique records only UNIQUE function

Remove duplicates in Excel

  1. Select the range, or click any cell in a table.
  2. On the Data tab, in the Data Tools group, select Remove Duplicates.
  3. Under Columns, tick the columns that define a duplicate. Select All and Unselect All help with wide tables.
  4. Select OK. Excel shows how many duplicate values were removed and how many unique values remain.
  5. If the result is wrong, use Undo (Ctrl+Z) immediately.

Microsoft says only the selected range or table changes; cells outside it do not move.

Which columns should you tick?

Microsoft's note is explicit: data is removed from all columns even if you tick only some. If you tick Column1 and Column2 but not Column3, the "key" is Column1 plus Column2, and a match deletes the entire record within the selected range, Column3 included.

  • All columns ticked: a row goes only if it is identical to an earlier row. Use this for rows pasted twice.
  • One ID or email column ticked: every later row with the same ID goes, even if its other columns hold newer information.

Microsoft's own example unticks a January column that holds prices, so prices do not affect the comparison.

How to choose which duplicate Excel keeps

Because Excel keeps the first occurrence, the row order decides what survives. Sort the data first so the row you want to keep comes first, for example newest date on top, then run Remove Duplicates on the ID column. This follows from Microsoft's rule: the Remove Duplicates box it documents offers column choices only, so sorting is how you control which row stays.

Why two rows that look the same were not removed

Excel compares what appears in the cell, not the stored value. Microsoft's example: the same date shown as "3/8/2006" in one cell and "Mar 8, 2006" in another counts as two unique values. Make the formats consistent, then run the tool again.

Remove Duplicates will not run

Microsoft says you cannot remove duplicates from data that is outlined or has subtotals. Remove the outline and the subtotals first. Microsoft also notes the counts in the final message might include empty cells and spaces, so check the row count yourself.

Remove duplicates in Google Sheets

  1. Select the data range. Selecting a single cell inside a range cleans the whole range.
  2. Choose Data > Data cleanup > Remove duplicates.
  3. Pick which columns to include and say whether the data has a header row.
  4. Click Remove duplicates.

Google's help page says cells with identical values but different letter case, formatting or formulas are treated as duplicates. If letter case matters in your data, such as product codes, do not rely on this tool.

To fix stray spaces first, use Data > Data cleanup > Trim whitespace. Google notes it does not trim non-breaking spaces.

Find duplicates first, delete second

Microsoft recommends highlighting or filtering duplicates before deleting them.

  1. Select the cells to check.
  2. Choose Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values.
  3. Pick a format and select OK.

This highlighting does not work in the Values area of a PivotTable report. To keep a clean copy without deleting anything, use Data > Advanced in Excel, choose "Copy to another location" and tick "Unique records only." In Google Sheets, the UNIQUE function returns the unique rows of a range in the order they first appear, leaving the source untouched; our UNIQUE function guide covers it step by step.

A safe five-step routine

  1. Copy the sheet or range to a backup tab.
  2. Highlight duplicates and scan them.
  3. Make date and number formats consistent, and trim extra spaces in Sheets.
  4. Sort so the row you want to keep comes first, then run Remove Duplicates with the right columns.
  5. Compare the row count before and after.

Remove duplicates FAQ

Does Remove Duplicates delete the whole row? Excel removes the matching record across all columns of the selected range, including columns you did not tick. Cells outside that range do not move.

Which duplicate does Excel keep? The first occurrence in the list. Sort first to control which row that is.

Is Google Sheets Remove duplicates case sensitive? No. Google treats identical values with different letter case as duplicates.

Can I undo it? In Excel, Microsoft lists Undo (Ctrl+Z) right after the change. Still keep a copy, because the deletion is otherwise permanent.

How do I remove duplicates without losing the original data? Use Advanced Filter with "Unique records only" and "Copy to another location" in Excel, or a UNIQUE formula, which builds a separate list and leaves the source untouched.

Sources

  1. Microsoft Support, Filter for unique values or remove duplicate values
  2. Microsoft Support, Find and remove duplicates
  3. Google Docs Editors Help, Split text, remove duplicates, or trim whitespace
  4. Google Docs Editors Help, UNIQUE function

About this guide

Howlane operator · Checked against the official sources listed above. It is general information, not professional advice.

AboutEditorial standardsCorrectionsReport an error

Edit history

  • Updated
  • Updated
  • Updated
  • Updated
  • Published