In Excel for Microsoft 365 on Windows, press Alt, then A, then M to open Remove Duplicates. These are sequential key presses, not keys to hold down together; check the columns and header option in the dialog before confirming, because Excel removes matching rows from the selected range.
The Windows shortcut and what it opens
The key sequence is commonly written as Alt+A, M. Press Alt to show ribbon Key Tips, press A to select the Data tab, and press M to open the Remove Duplicates dialog. The dialog lets you choose which columns Excel should use to decide whether records are duplicates. The shortcut opens the tool; it does not immediately delete anything.
Key Tips are letters displayed on the ribbon after you press Alt. If the letters shown on your screen differ, follow the displayed tips rather than guessing: ribbon key tips can vary with Excel versions, language, and interface changes. You can also open the feature with the mouse using Data > Remove Duplicates. In the dialog, review the column checkboxes and whether the first row contains headers, then select OK to run the removal.
How to remove duplicates safely
Start by selecting a cell inside your data or selecting the complete table range. If you select one cell in a contiguous block, Excel generally detects the surrounding data and uses it in the operation. Selecting the intended range yourself is safer when there are nearby notes, blank columns, or other data that should not be included.
- Make a copy of the worksheet or workbook if the original records may be needed later.
- Select the complete data range, including every column that belongs to each record.
- Press Alt, A, and M in sequence, or choose Data > Remove Duplicates.
- In the dialog, confirm whether your range has headers. Select the columns that define a duplicate record.
- Choose OK and read Excel’s message reporting how many duplicate values were removed and how many unique values remain.
For example, a customer list might have columns for Customer ID, Name, and City. If Customer ID uniquely identifies each person, select only that column in the dialog. Excel will then keep the first matching record and remove later rows with that ID from the selected range. If the whole row must match to count as a duplicate, select all three columns instead.
What Excel treats as a duplicate
Remove Duplicates compares the columns you check in the dialog. A row is considered a duplicate when its values match the corresponding values in those selected columns. Excel keeps the first occurrence in the current order and removes later matching records. Therefore, sorting the data first can determine which version survives. If two records share an email address but have different phone numbers, selecting Email alone treats them as duplicates; selecting Email and Phone requires both values to match.
It is important to distinguish removing duplicate records from merely finding repeated values. Remove Duplicates changes the selected data by deleting matching rows. It does not mark them, move them to another sheet, or preserve a separate list of what was deleted. If you want to review repeats without changing the source, use conditional formatting, a filter, or a separate formula-based result instead.
Differences in the underlying cell contents can also matter. Extra spaces, inconsistent punctuation, numbers stored as text, and dates represented in different ways may cause records that look alike to behave unexpectedly. Cell formatting can make distinct underlying values appear identical on screen. If the result is surprising, inspect and standardize the data before removing anything.
Choosing the right columns
The most consequential decision in the dialog is the definition of a duplicate. Select too few columns and Excel may remove records that are meaningfully different. Select too many and records that should be consolidated may remain because one nonessential field differs.
- Use an identifier column when each record has a reliable unique key, such as an order number or customer ID.
- Use all relevant fields when a duplicate means the entire record is repeated, such as identical product, date, quantity, and location values.
- Leave out changing details only when those details should not distinguish records. For instance, if the goal is one row per email address, a changed city may not matter.
Consider a sales table with Order ID, Item, Date, and Amount. If Order ID is unique, using it alone removes repeated order rows even if another column has been edited. If no single ID is reliable, select the fields that together describe an identical sale. When uncertain, make a copy and test the chosen columns on a small sample first.
Headers, selections, and row integrity
The My data has headers option matters because Excel should not treat column names as ordinary records. If the range includes a header row, make sure the option is selected and check that the column names appear in the dialog. If the range has no headers, clear the option. A mistaken header setting can lead to confusing column labels or incorrect comparisons.
Keep whole records together. If you select only one column from a multi-column list, Excel may warn that the selection does not include all adjacent data and ask whether to expand the selection. Expanding is normally the right choice when each row is a complete record. Choosing to continue with the current selection can remove repeated cells from only that column, leaving names, dates, or other fields out of alignment with their original records.
Blank rows or separated blocks can also affect which cells Excel recognizes as part of the data. A formatted Excel table can make the intended range easier to manage, but still verify the selection and the column choices before running the command. Avoid including totals, explanatory notes, or unrelated data beneath or beside the list.
Protecting data and undoing a removal
Remove Duplicates is a destructive cleanup operation: Excel deletes the later matching rows from the selected range. The command normally can be reversed immediately with Ctrl+Z on Windows, but undo is not a durable backup. Other edits made afterward, closing the workbook, or a long undo history can make recovery harder or impossible. Save a copy first when the data matters, especially before cleaning a large table or a shared workbook.
After removal, check the status message and inspect the remaining records. Confirm that the first retained version is the one you intended, that associated columns stayed together, and that the unique-row count makes sense. If the outcome is wrong, use Undo promptly and repeat the task with corrected columns or a corrected selection. Do not rely on the message alone as proof that the right rows were removed.
Mac and Excel for the web
The Windows sequence Alt+A, M is for Excel on Windows and should not be assumed to work on a Mac. In Excel for Mac, use the ribbon path Data > Remove Duplicates and follow the dialog. Keyboard behavior can differ across Mac versions, keyboard layouts, and settings, so use the visible ribbon command when you need a dependable route.
Excel for the web also provides a Remove Duplicates command on the Data tab, but Windows desktop Key Tips may not apply in a browser. If you do not see the command, confirm that the workbook is editable and that the ribbon is expanded. For a workbook shared with other people, consider making a copy or checking that you have permission to make changes before removing rows.
Alternatives when you want to review first
If deletion feels too final, use a method that reveals repeated records before changing the source. Conditional formatting can highlight repeated values in a chosen range, which is useful for visually reviewing one column. A filter can help you examine categories, while sorting can group similar entries together. These approaches do not necessarily identify duplicates across a complete multi-column record by themselves, so choose the method based on what makes a row a duplicate.
In Microsoft 365 and Excel 2021 or later, the UNIQUE function can return distinct values in a separate area while leaving the original list intact. For example, with names in A2:A20, =UNIQUE(A2:A20) returns each distinct name once. This formula creates a separate result rather than deleting source rows, and it is useful for a list of unique values in one column. It is not a direct replacement when you need to retain complete rows based on a combination of fields.
For a repeatable cleanup of a larger dataset, Power Query can import, transform, and deduplicate data while keeping the original source separate. Its Remove Rows > Remove Duplicates option can be applied to selected columns, much like the worksheet command. The query can be refreshed when the source changes, which is useful for recurring imports. As with the ribbon tool, carefully define the columns: removing duplicates based on the wrong fields changes which records remain.
Frequently Asked Questions
Is Alt+A, M a single shortcut in Excel?
It is a sequence of Key Tips in Windows Excel: press Alt, then A, then M. Do not press all three at once. The sequence opens the Remove Duplicates dialog, where you still need to confirm the settings.
Does Remove Duplicates keep the first or last row?
It keeps the first matching record in the current order and removes later matches. Sort the data first if a particular record should be the one that remains.
Can I remove duplicates based on just one column?
Yes. In the dialog, select that column and clear the other column checkboxes. Excel uses the selected column to identify repeated records, but removes the corresponding rows from the selected range.
Does the command delete an entire row?
It removes duplicate rows within the selected data range. Include the complete record in the selection so fields remain together; avoid running it on just one column when the surrounding columns belong to the same records.
How do I remove duplicates in Excel for Mac?
Choose Data > Remove Duplicates on the ribbon. The Windows Alt+A, M Key Tip sequence is not the Mac shortcut, so use the menu command if you are unsure of a Mac-specific keyboard equivalent.
Related
- Excel Text to Columns: Can You Make It Automatic?
- Excel Print Area: Set, Adjust, and Troubleshoot
- Excel Page Breaks Keep Appearing? How to Stop Them
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- How to Delete an Extra Page in WordTo delete an extra page in Word, first show formatting marks with Ctrl+Shift+8 on Windows or Command+8 on…
- Excel Shortcut Keys to Change Sheets: Windows and MacIn Excel for Microsoft 365 on Windows, press Ctrl+Page Up to move to the previous worksheet, or Ctrl+Page…
- How to Add a Header Template in WordTo add a header template in Microsoft Word, open the document, choose Insert > Header, select a built-in…
- Excel Data Validation List Based on Another Cell ValueYes. In Excel for Microsoft 365 on Windows, select the cell for the dropdown, then choose Data >…
- Remove Duplicates in Excel: Steps, Checks, and Safe OptionsYes. In Excel for Microsoft 365 on Windows, select your data, choose Data > Remove Duplicates, select the…
- Google Sheets Freeze Rows Shortcut and Menu StepsGoogle Sheets has no dedicated keyboard shortcut that immediately freezes rows. In a web browser, use View >…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.