<link rel="stylesheet" type="text/css" href="/mirawhite.css">

How to remove duplicates in Excel

Updated November 24, 2026

In Excel, click inside your table, go to Data > Remove Duplicates, tick the columns that must match and click OK: Excel keeps the first occurrence of each row and deletes the others. To keep the original data intact, use the formula =UNIQUE(A2:A500) instead (Excel 2021 and Microsoft 365). In Google Sheets, the command is Data > Data cleanup > Remove duplicates.

Remove duplicates with the Data tab (all Excel versions)

This is the quickest method. It works in Excel 2007 and later on Windows, in Excel for Mac and in Excel for the web. It deletes rows for good, so work on a copy of the sheet if you are not sure of the result.

  1. Click any cell inside your table, or select the exact range to clean.
  2. Go to Data > Remove Duplicates, in the Data Tools group.
  3. Leave “My data has headers” ticked if the first row holds column names.
  4. Tick the columns that define a duplicate: all of them to remove identical rows, or only Email to keep one row per email address.
  5. Click OK. Excel tells you how many duplicate values were removed and how many unique values remain.

Good to know : Excel keeps the first occurrence, the highest row, and deletes the copies below it. To keep the most recent entry instead, sort the table by date, newest first, before you run Remove Duplicates. Ctrl+Z undoes the deletion right after.

Remove duplicates with a formula: UNIQUE

UNIQUE returns the list without duplicates in another place and updates itself when the source changes. It exists in Excel 2021, Excel 2024, Microsoft 365, Excel for the web and Google Sheets, but not in Excel 2019 or older.

Type the formula in an empty cell: the result spills down into as many cells as needed. If one of those cells is not empty, you get a #SPILL! error.

  • =UNIQUE(A2:C500) returns unique rows across three columns: a row is dropped only if all three values repeat.
  • =SORT(UNIQUE(A2:A500)) returns the unique values in alphabetical order.
  • =UNIQUE(A2:A500,,TRUE) returns only the values that appear exactly once, which is not the same as removing duplicates.
  • To turn the result into fixed values, copy it and use Home > Paste > Paste Special > Values.
=UNIQUE(A2:A500)

Highlight duplicates before deleting them

Checking what will go is often wiser than deleting straight away, especially with names typed by hand.

  1. Select the column to check.
  2. Go to Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values.
  3. Keep “Duplicate” and a color, then click OK. Every repeated value is colored, the first copy included.
  4. To flag only the extra copies, add a helper column with the formula below, fill it down, then filter the column on TRUE.
=COUNTIF($A$2:A2,A2)>1

Good to know : This formula returns TRUE from the second occurrence on, so deleting the filtered TRUE rows keeps exactly one copy of each value. =COUNTIF($A$2:$A$500,A2) tells you how many times each value appears in the column.

Duplicates across several columns

A duplicate is not always a fully identical row. Two orders from the same customer on different dates are not duplicates, while the same first name, last name and date of birth probably are.

In the Remove Duplicates dialog, tick only the columns that together identify a record. Excel compares those columns and keeps the first full row. With formulas, =UNIQUE(A2:C500) works on several columns, and COUNTIFS flags rows whose first two columns repeat:

=COUNTIFS($A$2:A2,A2,$B$2:B2,B2)>1

Good to know : Remove Duplicates ignores case, so “Paris” and “PARIS” count as the same value. A trailing space, however, makes two values different: clean the column first with =TRIM(A2).

Remove duplicates in Google Sheets and LibreOffice

UNIQUE also works in Google Sheets: =UNIQUE(A2:A) returns the column without duplicates. To highlight duplicates there, use Format > Conditional formatting, pick “Custom formula is” and enter =COUNTIF($A$2:$A,A2)>1.

In LibreOffice Calc, select the column, open Data > More Filters > Standard Filter, set a condition that every row meets (for example the column is not empty), then expand Options and tick “No duplications”. You can also choose to copy the results to another place.

  1. In Google Sheets, select the range, headers included.
  2. Go to Data > Data cleanup > Remove duplicates.
  3. Tick “Data has header row” if needed, then the columns to analyze.
  4. Click Remove duplicates. Sheets reports how many duplicate rows were removed.

Common problems

  • You see duplicates but nothing is removed: the values differ by a hidden space, a non-breaking space copied from a web page, or a number stored as text. Clean the column with =TRIM(A2), and convert numbers with the green warning icon > Convert to Number.
  • Too many rows were removed: you ticked a single column, so rows that share that value but differ elsewhere were deleted. Undo with Ctrl+Z and tick more columns.
  • Excel shows a Remove Duplicates warning: you selected one column inside a wider table. Choose “Expand the selection”, otherwise the other columns stay in place and your rows get misaligned.
  • The command is grayed out: the sheet is protected, or a cell is still in edit mode. Press Enter or Esc, or unprotect the sheet.
  • #NAME? with UNIQUE: your Excel does not have the function. Use Data > Remove Duplicates, or Data > Advanced with “Copy to another location” and “Unique records only”.

Remove duplicates online with Utiloz

If your list is not in a spreadsheet, or you want a clean list without touching the file, paste it into Remove duplicate lines on Utiloz, one item per line. The first occurrence of each line is kept and the original order is preserved. Options let you ignore case, accents and blank lines, or show only the lines that were repeated.

The list is processed in your browser: nothing is uploaded and there is no sign-up. The tool compares whole lines, so it works on one column at a time, and “Paris, France” and “Paris” stay two different lines. For a full table saved as CSV, Remove duplicate CSV rows compares every column or only the ones you pick.

Frequently asked questions

How do I remove duplicates in Excel but keep one?

Data > Remove Duplicates already keeps one copy of each row, the first one in the range. The formula =UNIQUE(A2:A500) also keeps one copy; only =UNIQUE(A2:A500,,TRUE) drops every value that repeats.

How do I remove duplicates in Excel with a formula?

In Excel 2021, 2024 or Microsoft 365, use =UNIQUE(A2:A500). In older versions, add a helper column with =COUNTIF($A$2:A2,A2)>1, filter it on TRUE and delete those rows.

How do I find duplicates between two columns in Excel?

Next to column A, type =COUNTIF($B$2:$B$500,A2)>0 and fill it down: TRUE means the value also appears in column B. Selecting both columns and applying Duplicate Values in Conditional Formatting colors them too, along with repeats inside each column.

Does Remove Duplicates delete the whole row?

It deletes the whole row within the selected range, even if you ticked a single column. Cells outside the range are left in place, which is why Excel offers to expand the selection.

← All guides