How to Remove Duplicates in Excel
A bearded man in his forties tidying a long customer list on a laptop in a front desk of a professional services firm, highlighter and papers on the desk

How to Remove Duplicates in Excel

In Excel for Microsoft 365 on Windows, select your data, then select Data > Remove Duplicates. Check the columns that must match, then select OK. Excel keeps the first copy of each row and deletes the rest. Make a copy of the sheet first, because Remove Duplicates permanently deletes the extra rows.

Highlight duplicates before you delete them

Start here when you want to see which values Excel treats as duplicates before anything is deleted.

  1. Select the cells you want to check, such as a column of customer names or invoice numbers.
  2. Select Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values.
  3. Pick a format for the duplicates, then select OK.
  4. Review the highlighted cells and decide which rows really are duplicates.
  5. To remove the highlighting later, select the cells, then select Home > Conditional Formatting > Clear Rules > Clear Rules from Selected Cells.

Excel for Mac uses the same menu to highlight duplicates. In Excel for the web, it’s Home > Conditional Formatting > Highlight Cell Rules > Duplicate Values.

Remove duplicates in Excel for Windows

Use this in Excel for Microsoft 365, Excel 2024, 2021, 2019 or 2016 on a Windows PC when you want the extra rows deleted.

  1. Make a copy first. Right-click the sheet tab, select Move or Copy, check Create a copy and select OK.
  2. Select the range that holds the duplicates, or select any cell in an Excel table.
  3. Select Data > Remove Duplicates.
  4. Under Columns, check the columns that must all match for a row to count as a duplicate. Select All and Unselect All speed this up.
  5. Select OK. A message says how many duplicate values were removed and how many unique values remain. Select OK to close it.
  6. If the result looks wrong, press Ctrl+Z right away to undo it.

Excel deletes the whole row, including columns you didn’t check. If you check only a Customer column, every later row for that customer is removed, even when its other columns differ.

Copy only the unique values to a new spot

Use Advanced Filter, in Excel for Windows or Mac, when you want a clean list but need the original data left exactly as it is.

  1. Select the range, or select any cell in the table.
  2. Select Data > Advanced, in the Sort & Filter group.
  3. Select Copy to another location.
  4. In the Copy to box, enter an empty cell where the list should start, such as H1.
  5. Check Unique records only and select OK.

Use the UNIQUE function

Use UNIQUE in Excel for Microsoft 365, Excel 2024, Excel 2021 or Excel for the web when you want a duplicate-free list that updates as the data changes.

  1. Select an empty cell with enough blank cells below it for the list.
  2. Type =UNIQUE(A2:A100), using your own range, and press Enter. The results spill into the cells below.
  3. To sort the list too, use =SORT(UNIQUE(A2:A100)).
  4. To list only values that appear exactly once, use =UNIQUE(A2:A100,,TRUE).
  5. If the data is in an Excel table, refer to the table column, such as =UNIQUE(Table1[Customer]), so the list grows and shrinks with the table.

If UNIQUE shows #SPILL!, something is in the cells below it. See our guide to the #SPILL! error in Excel.

In Excel for the web

Use this when you open the workbook in a browser, for example from OneDrive, SharePoint or Teams.

  1. To keep a copy, right-click the sheet tab and select Duplicate.
  2. Select the range, or select any cell in the table.
  3. Select Data > Remove Duplicates.
  4. Clear the check box for any column that shouldn’t be compared.
  5. Select OK, then select OK on the message that shows how many duplicates were removed.
  6. To get the data back, select Undo or press Ctrl+Z.

On a Mac

Use this in Excel for Microsoft 365 for Mac, Excel 2024 for Mac or Excel 2021 for Mac.

  1. To keep a copy, hold Option and drag the sheet tab along the row of tabs. Release the mouse button before the Option key.
  2. Select the range, or select any cell in the table.
  3. Select Data > Remove Duplicates.
  4. Check the columns to compare. To pick only a few, clear Select All first.
  5. Select Remove Duplicates.

If it doesn’t work

  • Rows that look the same aren’t removed. Excel compares what each cell displays, so 1.00 and 1 count as different, and so does the same date shown in two formats. Extra spaces make values differ too. Put =TRIM(A2) in a helper column and copy it down, then paste the results over the original column with Home > Paste > Paste Special > Values and run Remove Duplicates again.
  • Excel won’t remove duplicates from your list. It can’t when the data has subtotals or an outline. Select a cell in the data, select Data > Subtotal > Remove All, or Data > Ungroup > Clear Outline, and try again.
  • The wrong rows were deleted. Press Ctrl+Z right away. If the file is already closed, restore your copy or restore a previous version of the file.
  • UNIQUE shows #NAME?. UNIQUE needs Excel for Microsoft 365, Excel 2021 or later, or Excel for the web. In Excel 2019 or 2016, use Remove Duplicates or Advanced Filter instead.
  • Nothing highlights in a PivotTable. Excel can’t highlight duplicates in the Values area of a PivotTable, so check the source data instead.

When should you call IT?

  • The duplicates come from a system export, such as your CRM or accounting software, and keep coming back. The fix belongs in that system.
  • The workbook is shared or feeds other reports, and deleting rows would change totals other people use.
  • You removed rows, saved and closed the file, and need the old data back.
  • Excel freezes when you run Remove Duplicates or UNIQUE on a large file. See our guide to Excel not responding.

If files like this need to be recoverable, see our cloud backups page.

OAC Technology’s IT support team fixes problems like this for businesses across the Twin Cities. Clients can call 952-548-5558, Monday to Friday, 8 a.m. to 6 p.m. Central. Not a client yet? Call the same number or send us a message.

Common questions

What is the shortcut key for removing duplicates in Excel?

Microsoft’s list of Excel shortcuts doesn’t include a single key for Remove Duplicates, but Key Tips get you there from the keyboard. Press Alt, then A to open the Data tab, then press the letter Excel shows on Remove Duplicates.

How to remove duplicates in Excel but keep one?

Remove Duplicates already keeps one. It keeps the first copy of each value and deletes the later ones, so sort the data first if a particular row should be the one that stays.

How do I remove duplicates based on one column?

In the Remove Duplicates box, select Unselect All, then check only that column. Excel deletes every later row that repeats a value in that column, along with the data in its other columns.

Can I undo Remove Duplicates?

Yes. Press Ctrl+Z or select Undo right after you run it, and if you’ve already closed the file, restore the copy you made or an earlier version of the file.

How do I remove both duplicates, not just the extra copy?

Use =UNIQUE(A2:A100,,TRUE). It lists only the values that appear exactly once, so every value that has a duplicate is left out.

Why can’t I find or use Remove Duplicates in Excel?

Remove Duplicates is on the “Data” tab in the “Data Tools” group, or you can type its name in the “Search” box at the top of Excel. It’s unavailable while you’re still typing in a cell, so press Enter first, and in Protected View until you select “Enable Editing” for a file you trust. Excel also can’t remove duplicates from data with subtotals or an outline, so remove those first.

How do I find duplicates in Excel with a formula?

Use COUNTIF in a helper column. If your values are in A2:A100, type =COUNTIF($A$2:$A$100,A2)>1 in row 2 of an empty column and fill it down, and every copy of a repeated value shows TRUE, including the first. Then select “Data” > “Filter”, select that column’s arrow and show only TRUE.

Related guides

Author picture

OAC Technology

Author

Related Articles