Skip to content
EditFlip
ENRO
Back to blog
Excel

How to find, highlight and remove duplicates in Excel

Highlight first, delete second. Conditional formatting shows you the duplicates without touching them, and Remove Duplicates deletes them once you have looked.

Eric Rada · Founder · · 6 min read

In short

  • Select the cells, then go to Home, Conditional Formatting, Highlight Cells Rules, Duplicate Values, and press OK. Every repeated value turns coloured and nothing is deleted.
  • To delete them, use Data, Remove Duplicates. It keeps the first row of each and removes the rest for good, so work on a copy.
  • Tidy a list, then make it a PDF on EditFlip

A mailing list with the same customer twice, an order sheet with a repeated invoice number, a list of names pasted together from three places. Duplicates are easy to make and tedious to find by eye. Excel has two tools for them, and they do different jobs: one shows duplicates, the other removes them.

This guide uses them in the safe order. First you look, then you delete. It also covers the cases people get wrong: duplicates that are only duplicates across a whole row, values that look equal but are not, a check between two columns, and how to remove the rows you spotted by hand when you only want a few gone. EditFlip does not find duplicates for you, and the guide says where it fits.

On EditFlip, step by step

  1. Step 1

    Copy the sheet first

    Remove Duplicates cannot be undone once you save and close. Right-click the sheet tab, choose Move or Copy, tick Create a copy, and work on the copy. Or save the workbook under a new name.

  2. Step 2

    Highlight the duplicates

    Select the column or the range. Go to Home, Conditional Formatting, Highlight Cells Rules, Duplicate Values. Leave Duplicate in the first box, pick a colour and press OK. Repeated values change colour at once, and the original numbers stay as they are.

  3. Step 3

    Look before you delete

    Scroll through the coloured cells. Check that two highlighted entries are truly the same thing, not two people with the same name. Sort the column to bring the duplicates next to each other.

  4. Step 4

    Remove them, or tidy the list on EditFlip

    Select the range, go to Data, Remove Duplicates, tick the columns that decide what a duplicate is, and press OK. For a short list you can instead choose the workbook on editflip.com, press Edit, and use Delete row on each repeated row. Then press Done.

Highlighting versus removing

Conditional formatting only paints. The cells keep their values, and if you change an entry so it is no longer a duplicate, the colour goes away by itself. That makes it the right tool for a first look, for checking a list now and then, and for any sheet that other people edit.

Remove Duplicates changes the data. It deletes every row that repeats an earlier one in the columns you select, and keeps the first. There is no colour left to remind you. When it finishes, Excel tells you how many duplicates it found and how many unique values remain, which is a useful number to compare with what you expected.

A good habit is to use both: highlight to see, remove to clean, and then highlight again to confirm nothing repeated is left.

Whichever you use, write down the row count before you start. A list of 500 rows that comes back with 480 is easy to reason about. A list that comes back with 120 tells you the duplicate rule was too loose, and you can still go back to the copy.

Duplicates across a whole row

A value repeated in one column is not always a duplicate row. Two orders from the same customer share a name but not an order number. If you select several columns in Remove Duplicates, Excel only treats a row as a duplicate when all the ticked columns match.

So tick exactly the columns that define a duplicate. For a customer list, that might be email address alone. For orders, it might be the order number. If you tick every column, only rows that are identical from end to end are removed.

If your range has titles in the first row, keep My data has headers ticked, or Excel will treat the titles as data and may delete them.

Values that look the same but are not

Excel ignores upper and lower case when it looks for duplicates, so Anna and ANNA count as one. That is usually what you want. It does not ignore spaces. A name with a space at the end is a different value to the same name without it, and Excel will not call them duplicates.

Numbers stored as text and real numbers are also different: 1042 typed as text and 1042 as a number are not matched. A green triangle in the corner of a cell is Excel hinting at this.

Before you remove, clean the column. The TRIM function takes out extra spaces, and the Text to Columns tool, or a multiplication by one, turns text numbers into real ones. Then run the highlight again, and more duplicates will often appear.

Comparing two columns or two lists

To see which names in column A also appear in column B, select column A, and go to Home, Conditional Formatting, New Rule, Use a formula to determine which cells to format. Type a formula such as =COUNTIF($B:$B,A1)>0 and pick a colour. Every entry in A that exists in B is coloured.

To see the ones that are only in A, change the test to =COUNTIF($B:$B,A1)=0. The A1 in the formula must be the first cell of your selection, with no dollar signs, so Excel moves it down the list for you.

Remove Duplicates works on one range at a time. To compare two lists safely, paste them one under the other in a copy, and run it there, or use the colours first and delete by hand.

Removing only the ones you chose

Sometimes you want to look at each pair and decide. Sort the column so repeated values sit together, then delete the rows you do not want by selecting them, right-clicking and choosing Delete. Selecting rows from the numbers on the left keeps whole rows together.

If the list is short, you can do this on EditFlip. Choose the workbook, press Edit, tap a cell in the row, and use Delete row. It works on any file the site opens, including a CSV, and you can go back with Undo. It does not find the duplicates for you, so it is for lists small enough to read by eye.

Pressing Done saves a new copy, named with “(edited)” after the name, and the original file is not changed.

Excel on the web, Google Sheets and Numbers

Excel for the web has the same conditional formatting and Remove Duplicates commands, with the same names, on the Home and Data tabs. The phone apps have fewer of them and move them around, so for a big clean-up a computer is easier.

Google Sheets does not use the same menu. For highlighting, use Format, Conditional formatting, choose Custom formula and enter =COUNTIF(A:A,A1)>1. For removing, use Data, Data cleanup, Remove duplicates.

Whatever the program, the order is the same: copy, highlight, look, remove, check again.

Common mistakes

The first is selecting only one column and removing duplicates, when the rows sit side by side. If the box asks whether to expand the selection, say yes, or the names will be sorted into a new order while the other columns stay behind. Check the warning dialog.

The second is deleting from the original file and saving over it. Keep a copy until you have checked the count, and compare it with the number Excel reported.

The third is trusting the colour alone. Highlighting a whole column that includes the title row can colour a title that matches a value. Select the data only, not the header, when you look for duplicates.

After you have found the duplicates in Excel, choose the workbook on EditFlip to delete rows by hand, or turn the cleaned list into a PDF to send. Free, no account, and the file stays on your device.

Tidy and share your list on EditFlip →

Questions

How do I highlight duplicates in Excel?

Select the cells, go to Home, Conditional Formatting, Highlight Cells Rules, Duplicate Values, choose a colour and press OK.

How do I remove duplicates in Excel?

Select the range, go to Data, Remove Duplicates, tick the columns that define a duplicate and press OK. It keeps the first row of each and deletes the rest.

Does Remove Duplicates delete the first or the last entry?

It keeps the first one it meets, from the top, and deletes the later ones.

How do I find duplicates between two columns?

Use a conditional formatting rule with a formula such as =COUNTIF($B:$B,A1)>0 applied to column A. The entries that also exist in column B are coloured.

Why does Excel not see my duplicates?

Usually extra spaces or numbers stored as text. Clean the column with TRIM first, then highlight again.

Can I undo Remove Duplicates?

Immediately, with Undo, yes. After you save and close, no. Keep a copy of the sheet before you start.

Can EditFlip find duplicates for me?

No. It can edit cells and delete rows by hand, and convert the finished sheet to a PDF.

Do it right in your browser.
Free, no account. Your files stay on your device.
Edit an Excel file