Skip to content
ArumSoft Learning
KO

    Everyday Excel Skills · Tutorial 11 of 14

    How to Remove Duplicates in Excel

    Delete repeated rows from a list with Remove Duplicates, choose which columns decide what counts as a duplicate, and check for duplicates before you delete.

    Level
    Beginner
    Time
    8 min read
    Updated:
    Applies to:
    Excel for Microsoft 365, Excel 2021, Excel 2019, Excel for the web
    COUNTIFS filled down column D. A 2 marks a row that appears twice; Ben's rows show 1 because their classes differ.
    Example: COUNTIFS filled down column D. A 2 marks a row that appears twice; Ben's rows show 1 because their classes differ.

    What you'll learn

    • Remove rows that are repeated in every column
    • Choose which columns decide whether two rows are duplicates
    • Find and count duplicates before deleting anything
    • Avoid the mistakes that leave duplicates behind or misalign rows

    Lists collect duplicates: the same person signs up twice, two exports get pasted together, a form is submitted again. Remove Duplicates deletes the repeated rows in one step and keeps the first copy of each. You decide which columns have to match for two rows to count as duplicates, which is the part that needs care.

    Where to find it

    Remove Duplicates is in the Data Tools group on the Data tab.

    Click any cell in your list and go to Data then Data Tools then Remove Duplicates. From the keyboard, press Alt, then A, then M. There's no right-click command. If your list is an Excel table, the same command is also on the Table Design tab, in the Tools group.

    Remove rows that repeat in every column

    This sign-up sheet has eight rows. Ana Lopez and Carla Diaz each signed up for Yoga twice, with exactly the same details. Ben Cho appears twice too, but for two different classes, so both of his rows are real sign-ups.

    ABC
    1NameEmailClass
    2Ana Lopezana@example.comYoga
    3Ben Choben@example.comPottery
    4Ana Lopezana@example.comYoga
    5Carla Diazcarla@example.comYoga
    6Ben Choben@example.comPainting
    7Dan Kimdan@example.comPottery
    8Carla Diazcarla@example.comYoga
    9Eve Parkeve@example.comPainting
    Rows 4 and 8 (red) repeat rows 2 and 5 exactly. Ben's two rows (amber) share a name and email but not a class.
    1. Click in the list

      Click any cell from A1 to C9. Excel selects the whole list for you when the dialog opens. If you select a range yourself, Excel uses that range instead, so let Excel pick it unless you have a reason not to.

    2. Open Remove Duplicates

      Go to Data then Data Tools then Remove Duplicates. The dialog lists every column of the list, all ticked.

      With My data has headers ticked, the dialog lists your headings. All three columns are ticked, so a row is removed only if all three match an earlier row.
    3. Check the header box and the columns

      Make sure My data has headers is ticked. When it is, the column list shows your headings (Name, Email, Class) and row 1 is never removed. Leave all three columns ticked. Click OK.

    4. Read the message

      Excel reports 2 duplicate values found and removed; 6 unique values remain. Click OK. Rows 4 and 8 are gone and the rows below moved up. Ben keeps both sign-ups, because his Class values differ.

      ABC
      1NameEmailClass
      2Ana Lopezana@example.comYoga
      3Ben Choben@example.comPottery
      4Carla Diazcarla@example.comYoga
      5Ben Choben@example.comPainting
      6Dan Kimdan@example.comPottery
      7Eve Parkeve@example.comPainting
      Six sign-ups remain. The first copy of each repeated row was kept.

    Remove Duplicates always keeps the first (highest) copy and deletes the ones below it. If you'd rather keep the newest entry, sort the list newest first before you remove duplicates.

    Choose which columns count

    The ticked columns decide what a duplicate is. Untick a column and Excel ignores it when comparing rows.

    Say you need a mailing list with one row per person. Run Remove Duplicates on the original eight rows again, click Unselect All, and tick only Email. Now Excel reports 3 duplicate values found and removed; 5 unique values remain: it also removes Ben's Painting row, because his email already appeared in row 3.

    ABC
    1NameEmailClass
    2Ana Lopezana@example.comYoga
    3Ben Choben@example.comPottery
    4Carla Diazcarla@example.comYoga
    5Dan Kimdan@example.comPottery
    6Eve Parkeve@example.comPainting
    With only Email ticked, each email appears once. Ben's Painting sign-up was removed, because only his first row was kept.

    That's right for a mailing list and wrong for a class register. Before you click OK, ask: "If two rows match in these columns only, is it really the same record?"

    Columns tickedRows removedWhat it's good for
    Name, Email, Class (all)4 and 8Removing exact repeats, keeping every real sign-up
    Email only4, 6 and 8One row per person, such as a mailing list
    Class onlyAll but the first row of each classA list of the classes on offer (best done on a copy)

    Check for duplicates first

    Remove Duplicates deletes rows. You can undo it with Ctrl+Z straight away, but it's safer to look before you delete, or to work on a copy of the sheet.

    • Highlight repeated values: select a column and go to Home then Styles then Conditional Formatting then Highlight Cells Rules then Duplicate Values. This colours every cell whose value appears more than once in the selection. It looks at single cells, so it can't tell you whether whole rows match.
    • Count matching rows: add a helper column with COUNTIFS, one pair of arguments per column you'd tick in the dialog. Any result above 1 is a row that Remove Duplicates would treat as a duplicate.
    =COUNTIFS($A$2:$A$9,A2,$B$2:$B$9,B2,$C$2:$C$9,C2)
    ABCD
    1NameEmailClassCount
    2Ana Lopezana@example.comYoga2
    3Ben Choben@example.comPottery1
    4Ana Lopezana@example.comYoga2
    5Carla Diazcarla@example.comYoga2
    6Ben Choben@example.comPainting1
    7Dan Kimdan@example.comPottery1
    8Carla Diazcarla@example.comYoga2
    9Eve Parkeve@example.comPainting1
    COUNTIFS filled down column D. A 2 marks a row that appears twice; Ben's rows show 1 because their classes differ.

    If you want the unique rows without touching the original, use =UNIQUE(A2:C9) in Microsoft 365 or Excel 2021 and later, or Advanced Filter with Unique records only. Both copy the unique rows elsewhere and leave the list as it is.

    Real-world scenarios

    Sales

    One row per customer ID

    Two exports were combined, and some customers appear twice with their name typed slightly differently. The Customer ID is the reliable key.

    ABC
    1Customer IDNameCity
    21001Oak CafeBoston
    31002Pine BooksDenver
    41001Oak CaféBoston
    51003Lake GymAustin
    61002Pine Books LtdDenver
    71004Hill BakerySeattle
    IDs 1001 and 1002 appear twice, with different spellings of the name.

    With all columns ticked, nothing would be removed, because "Oak Cafe" and "Oak Café" aren't the same text. Tick only Customer ID and click OK. Excel removes 2 rows and keeps 4 customers, each with the spelling from its first row.

    School

    Which electives were chosen?

    A form collected each student's elective. You want a short list of the electives that were picked, without changing the form responses.

    ABCD
    1StudentElectiveElective
    2MiaArtArt
    3LeoMusicMusic
    4SaraArtDrama
    5TomDramaRobotics
    6NinaMusic
    7OmarArt
    8JadeRobotics
    9IvyDrama
    Eight responses in A:B. Column D is a copy of the Elective column after Remove Duplicates: four electives.

    Copy B1:B9 to D1, select D1:D9, and run Remove Duplicates. Because column C is empty, Excel works on column D alone and leaves the responses alone. The result is Art, Music, Drama and Robotics.

    Personal

    A holiday card list

    You merged two address lists. Uncle Sam is listed twice, and so is Grandma Rose, but one of her rows has an invisible space after the name.

    AB
    1NameAddress
    2Grandma Rose12 Elm St
    3Uncle Sam5 Oak Ave
    4Grandma Rose 12 Elm St
    5Aunt May9 Pine Rd
    6Uncle Sam5 Oak Ave
    Row 6 repeats row 3 exactly. Row 4 looks like row 2 but its name ends with a space.

    Remove Duplicates removes Uncle Sam's second row but keeps both Grandma Rose rows, because "Grandma Rose " with a trailing space is different text. Clean the names first with =TRIM(A2) in a helper column, paste the results back as values, then run Remove Duplicates again.

    Common mistakes

    • Selecting one column of a bigger list. If you select cells in one column and other columns are next to it, Excel warns you and offers to expand the selection. Choose Expand the selection. If you continue with only your selection, Excel removes cells in that column alone and shifts the cells below up, so rows no longer line up with their other columns.
    • Leaving My data has headers unticked. The dialog then lists Column A, Column B and so on, and your heading row is compared like any other row. Tick the box when row 1 holds headings.
    • Unticking too many columns. Fewer ticked columns means more rows count as duplicates. Ticking only Name merges two different people who share a name.
    • Expecting near-duplicates to be removed. Extra spaces, different spellings and different formats aren't duplicates. Excel compares the values as they appear in the cells, so the same date shown in two different formats counts as two values. Clean the data first with TRIM and consistent formats.
    • Running it on subtotals or an outline. Remove Duplicates doesn't work on data that has subtotals or an outline. Remove them first (Data then Outline then Subtotal, then Remove All).

    Practice

    Practice

    Clean a sign-up list

    1. Type the eight-row sign-up list from the top of this page into a new sheet, or use a list of your own with a few repeated rows.
    2. Add the COUNTIFS helper column and find the rows that show 2.
    3. Copy the sheet (right-click the sheet tab, choose Move or Copy and tick Create a copy).
    4. On the copy, run Remove Duplicates with all columns ticked. Check that 6 rows remain.
    5. Undo, then run it again with only Email ticked. Which row disappears this time, and would you want that for a class register?

    Related

    Was this guide helpful? Spot a mistake? Send feedback · admin@arumsoft.com