Software & OS

How to Remove Duplicates in an Excel Column (3 Methods)

To remove duplicates in an Excel column, select the column, go to the Data tab, choose Remove Duplicates in the Data Tools group, and select OK. Excel keeps the first occurrence of each value and deletes the rows that repeat it.

That method changes your data in place. If you would rather keep the original and get a clean list beside it, use the UNIQUE function or the Advanced Filter, both covered below. Steps follow Microsoft's documentation for the desktop app; the Data tab layout can differ slightly between versions.

The example column used below

Suppose column A holds a header and six values:

A1  Fruit
A2  Apple
A3  Banana
A4  Apple
A5  Cherry
A6  Banana
A7  Apple

Three values are repeats (A4, A6 and A7), so after de-duplication three distinct values should remain: Apple, Banana and Cherry. You can check the arithmetic yourself: six values minus three repeats leaves three.

Method 1: Data > Remove Duplicates (deletes the repeats)

  1. Select the range, or click any cell in the column if the data is in a table.
  2. On the Data tab, select Remove Duplicates in the Data Tools group.
  3. Under Columns, tick the columns Excel should compare. Select All and Unselect All are available.
  4. Select OK. Excel shows a message saying how many duplicate values were removed and how many unique values remain.

Run on the example, the first Apple (A2), Banana (A3) and Cherry (A5) stay, and the rows holding the later repeats are deleted. The result is a three-item list. If you made a mistake, select Undo or press Ctrl+Z immediately.

What this method does to the rest of the row

Microsoft's page states that data is removed from all columns, even if you don't select all the columns in the dialog. In practice, a duplicate means the whole row goes. If column B holds a price next to each fruit and you de-duplicate only column A, the price on a deleted row is deleted with it. That is correct when each row is one record, and destructive when the neighbouring columns carry data you wanted to keep. Copy the sheet first if you are not sure.

Limits to know before you run it

  • Outlines and subtotals. Excel cannot remove duplicates from data that is outlined or has subtotals. Remove the outline or subtotals first (Data > Subtotal > Remove All, or Data > Ungroup).
  • It compares what you see. Microsoft says a comparison of duplicate values depends on what appears in the cell, not the underlying value. A cell showing 1/5/2026 and another showing Jan 5, 2026 are different, even if both hold the same date serial number, because they are displayed differently.
  • It is permanent. Microsoft calls it permanently deleting duplicate values. Undo works right after, not after you close the file.

In Excel for the web the steps are the same: select the range or table, choose Remove Duplicates on the Data tab, clear any columns you don't want checked, and select OK.

Method 2: the UNIQUE function (keeps the original)

If you have Excel for Microsoft 365, Excel 2024 or Excel 2021, a formula returns the distinct values without touching the source. In an empty cell, such as C2, enter:

=UNIQUE(A2:A7)

Press Enter. The result spills down into the cells below, one value per row:

C2  Apple
C3  Banana
C4  Cherry

The full syntax is =UNIQUE(array, [by_col], [exactly_once]). Leave by_col out for a single column. Set exactly_once to TRUE to return only values that occur exactly once, which would give just Cherry here, because Apple and Banana both repeat.

To sort the output as well, wrap it: =SORT(UNIQUE(A2:A7)). If the source is an Excel Table and you use structured references, Microsoft notes that the spill range resizes as you add or remove data. The spilled cells are formula results, so to turn them into plain values, copy them and use Paste Special > Values.

Older versions, such as Excel 2019 and earlier, do not have UNIQUE. Use Method 1 or Method 3 there.

Method 3: Advanced Filter with Unique records only

This works in every desktop version and copies the distinct values to a new place.

  1. Select the range, or click a cell in the table.
  2. On the Data tab, in the Sort & Filter group, select Advanced.
  3. In the Advanced Filter box, choose Copy to another location.
  4. Enter a cell, such as $C$1, in the Copy to box.
  5. Tick Unique records only and select OK.

Choosing Filter the list, in-place instead hides the duplicate rows rather than deleting them. Microsoft describes this as temporary: the repeats are only hidden, and clearing the filter (Data > Clear in the same group) shows them again. Excel for the web cannot find unique values this way, though it can remove duplicates.

Check for duplicates first with conditional formatting

Microsoft suggests filtering or conditionally formatting on unique values before you delete anything, so you can see what will go. Select the column, then on the Home tab choose Conditional Formatting > Highlight Cells Rules > Duplicate Values, pick a format, and select OK. Every cell whose value appears more than once is highlighted. Nothing is changed, and you can clear the rule afterwards.

Why Excel misses duplicates you can see

The usual cause is an invisible difference. Apple and Apple (with a trailing space) are two different values, so neither Remove Duplicates nor UNIQUE treats them as a pair. Imported or pasted text often has these spaces.

Add a helper column with =TRIM(A2) and fill it down, then de-duplicate that column. TRIM(text) removes extra spaces and leaves single spaces between words. Microsoft documents one limit: it removes only the standard space (character 32), not the nonbreaking space (character 160) common in text copied from web pages. For that, a common workaround is =TRIM(SUBSTITUTE(A2, CHAR(160), " ")), which swaps each nonbreaking space for an ordinary one before trimming.

Numbers stored as text cause a similar problem: 123 as a number and 123 as text look the same but are different cells to Excel. Convert them to one type first.

Which method should you use?

MethodChanges originalNeedsBest for
Remove DuplicatesYes, deletes rowsAny desktop version, or the webA one-off cleanup of a copy
UNIQUENoExcel 2021, 2024 or Microsoft 365A live list that updates with the data
Advanced FilterNo when copyingDesktop ExcelOlder versions, a static copy

Once the column is clean, you may want to count or look up values in it. See how to check if a value is in a list in Excel, or how to set up a pivot table to summarise the rows that remain.

Frequently asked questions

Does Excel keep the first or the last duplicate?
Excel keeps the first occurrence. Microsoft's documentation says the first occurrence of the value in the list is kept and other identical values are deleted, so the topmost row with a given value stays and later matches are removed.
Can I undo Remove Duplicates?
Yes, but only right after you run it. Select Undo or press Ctrl+Z straight away. Once you have made other changes and saved, the deleted rows are gone, so copy the column to another sheet first if you are unsure.
Why does Excel say there are no duplicates when I can see them?
The cells usually differ in a way you cannot see, most often a trailing space or a nonbreaking space. Excel compares what appears in the cell, so hidden characters make two values different. TRIM removes ordinary extra spaces but not the nonbreaking space (character 160).
How do I remove duplicates without deleting anything?
Use the UNIQUE function in Excel 2021, Excel 2024 or Microsoft 365, or the Advanced Filter with Unique records only checked and Copy to another location selected. Both leave the original column untouched and put the distinct values somewhere else.

Sources