Remove Duplicates in Excel: Keyboard Shortcut and Steps

How-to basics · Updated November 3, 2026

Remove Duplicates in Excel: Keyboard Shortcut and Steps

In Excel for Microsoft 365 on Windows, select a cell in your data and press Alt+A, then M to open the Remove Duplicates dialog. Choose the columns that define a duplicate and confirm; Excel keeps the first matching record and removes later ones.

The Windows keyboard shortcut

The shortcut is a sequence of ribbon KeyTips, not a two-key combination pressed at once. Press and release Alt, then press A to activate the Data tab, and press M to open Remove Duplicates. If your Excel version shows different KeyTips, follow the letters displayed on screen: they can vary with the ribbon layout, language, or version.

The sequence opens a dialog rather than deleting records immediately. Review its column options before choosing OK. The command works on a selected range, an Excel table, or a contiguous data region Excel identifies from the active cell. If the range is not obvious, select it yourself before using the shortcut so there is less chance of processing the wrong data.

On a Mac, use the ribbon menu path Data > Remove Duplicates; the Windows Alt+A, M sequence is not the Mac equivalent. In Excel for the web, use the Data tab’s Remove Duplicates command rather than relying on that Windows KeyTip sequence.

What Remove Duplicates considers a match

Excel compares the values in the columns you select in the dialog. If you select every column in a table, it removes rows whose values match across all of those columns. If you select just one column, two records are treated as duplicates when that field matches—even if their other fields differ. Excel deletes the entire later row, not just the repeated cell.

For example, suppose a contact list has Name, Email, and City columns. Selecting all three columns removes a repeated row only when the name, email, and city all match. Selecting Email alone treats two rows with the same email as duplicates, even if one has a different name or city. This can be useful when email is the identifier, but destructive if shared email addresses are legitimate.

The order of the rows matters: Excel keeps the first occurrence it encounters and removes subsequent matches. If you need a particular version of a record to survive—for example, the most recently updated one—sort the data into the desired order before removing duplicates. Consider adding a date or source column so you can make that choice deliberately.

Prepare the data before removing records

Before running the command, make a copy of the worksheet or save a separate version of the workbook. Remove Duplicates changes the selected data, although the ordinary action can usually be reversed immediately with Ctrl+Z on Windows or Command+Z on Mac. A backup is safer if you may need to compare, audit, or restore the original records later.

  • Check that the first row contains headings if your range has headers. In the dialog, verify whether My data has headers is selected correctly; an incorrect setting can make Excel treat a heading as a record or omit a row from comparison.
  • Confirm the full data range, including all columns that belong to each record. Selecting only one column can cause Excel to remove whole rows based on that single field.
  • Look for inconsistent spaces, spelling, and data entry. For instance, two names that look alike may contain a trailing space, while different capitalization generally does not make text a distinct match.
  • Decide which version of a repeated record should remain. Sort by a reliable field, such as an update date, before running the command if the first row is not automatically the one you want to keep.

Cell appearance is not a dependable way to judge equality. Formatting, such as a different font or fill color, is not the same as a different record value. Data imported from other systems may also contain inconsistent types or hidden characters, so inspect suspicious examples rather than assuming that visually similar cells will be handled as intended.

Remove duplicates step by step

  1. Click a cell inside the table or select the exact range to clean. If the data has gaps or adjacent unrelated content, selecting the range explicitly is especially important.
  2. Press Alt+A, then M on Windows. Alternatively, choose Data > Remove Duplicates on the ribbon.
  3. In the dialog, confirm the header setting and review the list of columns. Clear the checkboxes for fields that should not be part of the duplicate test. Leave checked only the fields that together identify a repeated record.
  4. Choose OK. Excel reports how many duplicate values or rows were removed and how many unique values remain. Review the remaining records, especially if the selected columns were only part of the table.
  5. If the result is not right, undo immediately with Ctrl+Z on Windows or Command+Z on Mac, then adjust the selection or columns and try again.

When the data is formatted as an Excel table, the command can remove duplicate table rows while maintaining the table structure. If you are working with a plain range, check that the range did not include unrelated columns or surrounding data. Do not assume that Excel’s detected selection matches your intention when multiple blocks of data are close together.

Choosing the right columns

The most important decision is what counts as one record in your situation. A row is not necessarily a duplicate just because one field repeats. Two orders can have the same customer name but different order numbers; two employees can share a surname; and a product can appear on many legitimate sales rows. Select a combination of fields that defines identity, not simply the column with the most repeated values.

A useful way to decide is to describe the rule in plain language before opening the dialog. For example, “same invoice number means the same invoice” points to selecting Invoice Number. “Same customer, product, and transaction date means a duplicate sale” points to selecting those three fields together. If there is no trustworthy identifier, review the candidate matches before deleting anything.

When you select several columns, Excel uses their combined values as the comparison key. It does not require each individual field to be unique. Two rows with the same customer but different invoice numbers remain distinct if Invoice Number is among the selected columns. Conversely, selecting only Customer can remove records that differ in every other field.

Common problems and misconceptions

A frequent mistake is thinking the command highlights duplicates or removes only repeated cells. It does neither: it deletes entire rows from the selected data. Another is leaving all columns selected when the real rule is based on a unique ID. That setting only removes rows that match across every selected field, so records with small differences elsewhere may remain.

Blank values need attention too. If the chosen key column is empty in several records, those records may be considered duplicates on that selected field. If blanks are meaningful or should be investigated, filter them or inspect them separately before removal. Similarly, a difference caused by a leading or trailing space can prevent two entries from matching even when they look identical at a glance.

Text comparison is generally not case-sensitive for this operation, so values such as “North” and “NORTH” should not be relied on as separate identifiers. If capitalization carries meaning in your data, check the records carefully and use a process designed to preserve that distinction. After cleaning, verify a few retained rows against the original or a backup rather than treating the removal count as proof that the outcome is correct.

If the shortcut does not open the dialog, make sure Excel has focus and that you are using the Windows sequence in desktop Excel. KeyTips may differ in localized versions or if the ribbon has changed. Use the Data tab and click Remove Duplicates directly; this also confirms that the command is available in your current interface.

Remove Duplicates versus other ways to find them

Use Remove Duplicates when you want to permanently reduce the selected list to one occurrence of each chosen key. Use conditional formatting when your goal is to flag repeated values for inspection without deleting rows. The distinction matters: highlighting lets you review which records differ in other fields, while Remove Duplicates makes an immediate change to the data.

Excel’s UNIQUE function is another option in Microsoft 365 and Excel 2021 or later. It returns a distinct list in a separate area rather than deleting source rows, which is useful when you want to preserve the original data or create a clean report. For a multi-column range, it can return distinct rows based on the full set of columns supplied. The result is a formula-driven output, so it is not the same as editing the original table; if you need a fixed list, copy the result and paste it as values.

For a one-time cleanup, the dialog is often the quickest route. For recurring imports, a repeatable workflow such as Power Query may be more suitable, particularly when you need to document transformation steps and refresh the result later. The best approach depends on whether you want to delete records, highlight them, produce a separate distinct list, or repeat the same cleanup as new data arrives.

Frequently Asked Questions

What is the keyboard shortcut to remove duplicates in Excel?
In Excel for Microsoft 365 on Windows, press Alt+A, then M. This opens the Remove Duplicates dialog, where you choose the columns and confirm the operation.

Does Excel keep the first or last duplicate?
Excel keeps the first occurrence in the current row order and removes later matching rows. Sort the data first if you want a particular record to appear first and remain.

Can I remove duplicates based on just one column?
Yes. In the dialog, select only that column. Excel then removes entire later rows that match on the chosen field, even if other fields in those rows differ.

Can I undo Remove Duplicates?
Usually, yes, immediately after the command: press Ctrl+Z on Windows or Command+Z on Mac. If you have closed the workbook or need a dependable recovery path, use a saved copy rather than relying on undo history.

Is there a Remove Duplicates shortcut on Mac?
The Windows Alt+A, M KeyTip sequence does not apply. In Excel for Mac, use Data > Remove Duplicates on the ribbon.

Does Remove Duplicates delete only identical whole rows?
Not necessarily. It compares only the columns checked in the dialog. If you check one column, a match in that field is enough to remove a later entire row; checking every column makes the comparison depend on the full row.

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.