Remove Duplicates in Excel: Shortcut and Safe Steps

How-to basics · Updated November 21, 2026

In Excel for Microsoft 365 on Windows, select a cell in your data and press Alt+A, then M to open Remove Duplicates. Choose the columns Excel should compare, confirm whether your data has headers, and select OK; Excel keeps the first matching record and removes later duplicates.

The Windows shortcut and what it opens

The key sequence Alt+A, M is a ribbon KeyTip sequence, not a single simultaneous keystroke: press and release Alt+A, then press M. It opens the Remove Duplicates dialog from the Data tab. Depending on the Excel build, language, or ribbon configuration, KeyTips can differ; if M does not work, press Alt to display the on-screen letters and follow the one shown for the Data tab and Remove Duplicates command.

The equivalent mouse route is Data > Remove Duplicates. On Windows, Ctrl+Z undoes the removal immediately afterward, provided you have not taken an action that clears or disrupts the undo history. The shortcut is useful for repeated cleanup, but pausing to check the dialog is important: the selected columns determine which records Excel treats as duplicates.

What Remove Duplicates actually does

Remove Duplicates compares values in the columns you select and removes later rows that match an earlier row under that comparison. It does not merely color, hide, or mark duplicates. It changes the data by deleting duplicate records from the selected range or table. The first occurrence is retained, so sorting the data beforehand can affect which version survives when records differ in details you did not include in the comparison.

For example, suppose a customer list has Name, Email, and Last Purchase columns. Selecting all three columns removes only rows whose values match across all three. Selecting Email alone treats repeated email addresses as duplicates even if the names or purchase dates differ. That may be right when email identifies a customer, but wrong if multiple people share an address. The correct setting depends on what one unique record means in your dataset.

How to remove duplicates safely

  1. Save a copy of the workbook or duplicate the worksheet if the source data matters. Removal is a data-changing operation.
  2. Click a cell in the list, or select the full range or Excel table you want to clean. Include every column belonging to each record.
  3. Choose Data > Remove Duplicates, or use Alt+A followed by M on Windows.
  4. In the dialog, confirm My data has headers if the first row contains column names. Check or clear the boxes to define the comparison fields.
  5. Select OK and read Excel’s result message, which reports how many duplicate values were removed and how many unique values remain.
  6. Review the remaining records, especially the first retained occurrence of each group, before using the cleaned data elsewhere.

If your data is an Excel table, clicking inside it usually lets Excel identify the table range. A table’s header row is normally recognized, but still confirm the header option in the dialog. For a plain range, selection boundaries matter: explicitly select the full rectangular set of records when the neighboring columns belong together.

Choosing the right columns

The checkboxes in the dialog are not just a convenience; they define the duplicate test. Selecting every column finds rows that match across the whole record. Selecting a subset finds repeated keys, such as an invoice number or email address, even when other fields differ. Decide whether the goal is to remove identical rows or to keep one record per identifier.

  • Identical-row cleanup: Select all record columns. A row with the same customer and same order details can be removed as a repeat.
  • One record per identifier: Select only the unique key, such as Product ID. Excel keeps the first row for each ID, so sort first if a particular row should win.
  • Combination key: Select two or more columns, such as Date and Employee ID, when only that combination must be unique.

Suppose two rows share an email address but have different phone numbers. If Email is the only checked field, one row will be removed. If both Email and Phone are checked, both rows remain because the combination differs. Before proceeding, ask whether the checked columns express the business rule you actually want—not merely whether the rows look similar.

Headers, selection, and data preservation

When Excel asks whether the data has headers, mark the option only if the first row contains labels such as Name or Order ID. If a real data row is mistakenly treated as a header, it will not be compared like the other rows. If column labels are accidentally treated as ordinary data, they may be included in the duplicate scan.

For lists with related fields, select the complete table or contiguous range. If you choose to continue with only one selected column while adjacent data is outside the selection, cleanup may not preserve the relationship between the values and their neighboring fields as intended. A safer approach is to select the full records and then use the dialog’s checkboxes to specify which columns determine duplicates. Keep a backup when you are uncertain about the selection.

Remove Duplicates removes rows from the chosen dataset; it does not merge information from multiple records. If one duplicate row has a newer address and another has a more complete phone number, Excel does not combine those details. Resolve such conflicts deliberately—for example, sort by a reliable date field so the preferred occurrence comes first, or review and consolidate the records before deleting anything.

Common reasons duplicates remain

Two entries can look identical on screen yet contain different underlying text. Leading or trailing spaces, nonbreaking spaces copied from a website, hidden characters, and inconsistent punctuation can make values fail to match. Conversely, the comparison may find the same key even though other unchecked fields differ. If the result surprises you, inspect the exact columns and normalize the source values before trying again.

  • Check for extra spaces and inconsistent spelling, punctuation, or abbreviations.
  • Look for values stored in different forms, such as a number in one row and text that looks like a number in another.
  • Confirm that all columns needed for the duplicate rule are checked.
  • Confirm that the full set of records—not an unintended partial selection—was included.
  • Check whether formulas return the same visible result while the surrounding record differs in a meaningful way.

Excel’s removal command is not a fuzzy matching tool. It will not decide that Jon Smith and John Smith are probably the same person, or that two addresses with slightly different spelling refer to one location. Those cases need a review rule or a dedicated data-matching process. Likewise, case differences alone are generally not a reliable way to preserve separate records; use another identifier if capitalization is meaningful in your data.

Undoing removal and checking the result

If you notice a mistake immediately, press Ctrl+Z on Windows or Command+Z on Mac to undo the last operation. You can also select Undo on the Quick Access Toolbar. Undo is most dependable before you close the workbook or perform later actions that affect the undo stack. It is not a substitute for a backup, particularly when the workbook contains important records or several cleanup steps.

After removal, compare the result count with what you expected and spot-check records that shared an identifier. Excel reports a count in its confirmation message, but that count alone cannot tell whether the correct comparison columns were used. If the wrong rows were retained, undo, sort the source data so the preferred row appears first, and run the command again with the intended columns selected.

When to use another method

Use Remove Duplicates when you want a cleaned list that replaces the duplicates in place. If you need to inspect possible duplicates without deleting anything, use Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values to highlight repeated values in a selected range. Highlighting is a review aid, not a complete substitute for checking multi-column records.

In Microsoft 365, the UNIQUE function can return a distinct list in another area while leaving the source unchanged. It is useful for a dynamic output or a quick review, but it does not delete or reconcile source records. For broader repeatable cleaning and transformation steps, Power Query’s remove-duplicates feature may suit a refreshable workflow. Choose a method based on whether you want permanent cleanup, a visual warning, a separate distinct result, or a reusable data-preparation process.

Windows, Mac, and Excel for the web

The shortcut described here is for Excel for Microsoft 365 on Windows. On Mac, use the ribbon route Data > Remove Duplicates; there is not a matching default Alt+A, M Windows KeyTip sequence. Mac KeyTips and keyboard navigation differ, so use the visible ribbon command if you do not have a custom shortcut assigned.

In Excel for the web, use the Data tab’s Remove Duplicates command if it is available in the current interface. The web app’s keyboard behavior can differ from desktop Excel and may depend on browser shortcuts, so the ribbon is the clearest route. In all versions, check the selected range and comparison columns before confirming: the choice of records and fields matters more than the route used to open the dialog.

Frequently Asked Questions

What is the keyboard shortcut for Remove Duplicates in Excel?
In Excel for Microsoft 365 on Windows, press Alt+A, then M. These are sequential ribbon KeyTips. If the letters differ in your installation, press Alt and follow the displayed KeyTips, or choose Data > Remove Duplicates.

Does Excel keep the first or last duplicate?
It keeps the first occurrence in the current order and removes later matching rows. Sort the data before cleanup if a specific record should be kept, and make a backup before removing records.

Can I remove duplicates based on just one column?
Yes. In the Remove Duplicates dialog, clear all fields except the key column. Excel then removes later rows that repeat that value, even when unchecked fields differ, so verify that one value truly identifies a record.

Does Remove Duplicates delete the whole row?
It removes duplicate records from the selected range or table according to the checked columns; it does not combine their information. Select all columns that belong to each record so related fields remain together.

How do I remove duplicates without changing the original list?
Make a copy first, or use the Microsoft 365 UNIQUE function to produce a separate distinct list. For visual checking without deletion, use Conditional Formatting to highlight duplicate values.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.