To remove duplicate rows in Excel for Microsoft 365 on Windows, select a cell in your data and press Alt, then A, then M—one key after another. In the Remove Duplicates dialog, confirm the columns Excel should compare, then choose OK. The command keeps the first matching row and deletes later matches, so make a copy of important data first.
What You’ll Need
- An Excel workbook with a range or table containing the records you want to check.
- A clear idea of what counts as a duplicate: an identical complete row, or a repeated value in one or more particular columns.
- A backup or copied worksheet if you might need to restore deleted rows. The command changes the selected data directly.
The examples below assume Excel for Microsoft 365 on Windows. The shortcut uses Excel’s ribbon KeyTips, so it can vary if you use a different language or customized ribbon. On Mac or Excel for the web, use the menu route described below if the Windows key sequence is unavailable.
Step-by-Step
- Prepare and protect the data. If the records matter, save a separate copy of the workbook or duplicate the worksheet before removing anything. Check that each field has its own column and that the first row contains clear column headings. Remove completely blank rows within the data if they make the boundaries unclear. For a regular range, click inside the dataset; Excel usually detects the contiguous block. For an Excel table, click a cell inside the table. Avoid selecting just one column when you intend to delete whole records.
- Decide what Excel should treat as a duplicate. If two records count as duplicates only when every field matches, include every relevant column. If a repeated customer ID is enough, use the ID column alone—but be aware that Excel will keep one row for each ID and remove the others, even if other fields in those rows differ. Write down the intended rule before proceeding. This choice is more important than the keyboard shortcut because it determines which rows can be removed.
- Open Remove Duplicates with the shortcut. With the active cell inside the data, press and release Alt, press and release A, then press M. This is a sequence, not three keys held together. Excel opens the Remove Duplicates dialog. If the letters do not work, look for the KeyTips that appear on your ribbon after pressing Alt; a localized or customized Excel installation may assign different letters. You can also use the ribbon path Data > Remove Duplicates.
- Check whether your data has headers. In the dialog, confirm that My data has headers is selected if the first row contains labels such as Order ID or Email. If the first row is actual data, clear the checkbox. When headers are recognized, the column list shows their names; without headers, it may show generic labels such as Column1. A wrong setting can make Excel treat a heading as a record or exclude the first actual record from comparison.
- Select the comparison columns. Excel initially checks all listed columns. Leave them all selected to remove only rows that match across the complete set of chosen fields. Clear the checkboxes for fields that should not determine uniqueness. For example, to keep one row per email address regardless of name or date, select only the Email column. Verify the selection carefully: an unintended extra column can make apparent duplicates look unique, while too few columns can cause distinct records to be deleted.
- Run the removal and read the result. Choose OK. Excel removes later rows that match the selected column values and keeps the first occurrence in the current order. A message reports how many duplicate values were removed and how many unique values remain. Read that message before closing it; if the count seems implausible, undo immediately with Ctrl+Z and review the column selection, headers, and data range.
- Check the cleaned records. Scan the remaining rows and compare a few known examples with the original copy. Confirm that the first instance of each repeated key is the one you wanted to keep. If the order matters, sort the data before using Remove Duplicates so the preferred record appears first—for example, sort by a last-updated date from newest to oldest. Save the workbook after you are satisfied with the result.
On Mac: The Windows Alt+A, M KeyTip sequence is not the general Mac shortcut. Click a cell in the data and use Data > Remove Duplicates from the menu or ribbon, then follow the same dialog steps. In Excel for the web: Use Data > Remove Duplicates if the command is available in your ribbon; the Windows desktop KeyTip sequence may not apply. In either version, confirm the selected range and comparison columns before accepting the change.
Common Mistakes
Comparing the wrong columns: Selecting only a name column can remove different people who share a name. Selecting every column can leave records that you consider duplicates because a timestamp or note differs. Define the matching rule first, then select columns to match that rule.
Removing duplicate cells instead of duplicate records: If Excel warns that the selected range contains more columns than the current selection, choosing to continue with only the current selection can affect just that column. That may leave the remaining fields misaligned with their original records. Choose the option to expand the selection when you want complete rows removed, or cancel and select the whole dataset before running the command.
Misidentifying the header row: Marking the first data row as a header can exclude it from the comparison. Treating headings as data can also lead to confusing results. Check the checkbox and the column labels in the dialog rather than assuming Excel guessed correctly.
Expecting formatting or case to define uniqueness: Remove Duplicates compares cell values in the selected columns, not visual formatting such as color or font. Differences in capitalization alone are generally treated as duplicates by this command. If capitalization or a specific formatting-derived category matters, create a helper value or use another review method before deleting records.
Forgetting that the first match survives: Excel does not automatically choose the newest, most complete, or otherwise best record. It keeps the first occurrence in the current row order. Sort records into the order you want before removing duplicates, and preserve a backup if the choice could matter.
Tips
- Turn a range into a table when useful. Select the dataset and use Insert > Table, confirming the header setting. Tables make it easier to identify the data boundary and keep headings visible, but they do not change the need to choose comparison columns correctly.
- Sort before deduplicating. If one row per account should remain and the most recent record is preferred, sort the date column newest to oldest first. Remove Duplicates then retains the first row it encounters for each selected account value.
- Use the dialog as a review checkpoint. The selected column names summarize the rule Excel is about to apply. Pause there, especially when dealing with several similarly named fields or a large range.
- Keep a repeatable record-cleaning process. If you regularly receive refreshed data, consider retaining a clean source copy and documenting which columns define a duplicate. Remove Duplicates is a one-time change to the current range; it does not automatically monitor future entries.
- Know the difference between duplicate rows and duplicate keys. Identical full rows are only one kind of duplicate. If an order number repeats but other fields vary, removing duplicates by order number discards entire rows. Confirm that this is the intended outcome before using one key column.
Troubleshooting
The shortcut does not open the dialog. Make sure you are in the Windows desktop version and press the keys in sequence: Alt, A, M. If the ribbon shows different letters after you press Alt, follow those KeyTips instead. The ribbon may be localized, or the command may be arranged differently in your version. As a dependable alternative, click Data > Remove Duplicates. On Mac, use the Data menu or ribbon rather than relying on Windows KeyTips.
Excel reports zero duplicates. Check whether all columns are selected when you intended to compare only an ID or email field. A difference in any selected value means two records do not match across that selection. Also inspect hidden spaces, inconsistent spelling, and values stored differently, such as a number in one row and text in another. Formatting alone is not proof that the underlying values match. If appropriate, clean or standardize the source values, then run the command again on a copy.
Too many rows disappeared. Press Ctrl+Z immediately if the operation is still the most recent change. Confirm whether the dialog used only a key column and whether the header option was correct. If Undo is unavailable—for example, after closing and reopening the workbook—restore the backup or use version history if your file is stored in OneDrive or SharePoint. Do not continue editing the affected data before checking recovery options.
Some records that look the same remain. The command only compares the columns you selected, but spaces, inconsistent data types, or other underlying value differences can still affect matching. Check the actual cell contents and consider normalizing the source first. For instance, remove unintended leading or trailing spaces in a separate copy, review the cleaned values, and then repeat the removal. Avoid deleting rows until you know why the values differ.
The result affected the wrong area. Undo at once, then select a cell within the intended dataset and verify its boundaries. Blank rows or columns can split a block, while selecting an isolated column can prompt Excel to work on that selection only. For a table, click inside the table and confirm the dialog lists the expected table headings before proceeding.
Frequently Asked Questions
What is the shortcut to remove duplicates in Excel?
In Excel for Microsoft 365 on Windows, press Alt, then A, then M. Press each key in sequence. If it does not work in your language or ribbon setup, use Data > Remove Duplicates.
Does Remove Duplicates delete the first occurrence?
No. Excel keeps the first matching record in the current order and removes later matches, based on the columns selected in the dialog. Sort beforehand if you want a particular record to be kept.
Can I remove duplicates based on just one column?
Yes. In the dialog, select only that column. Excel then keeps one row for each distinct value in it and removes other rows with the same value, including differences in fields you did not select.
Can I undo Remove Duplicates?
Usually, press Ctrl+Z immediately after the operation. If you have made other changes or closed the workbook, Undo may no longer be available, so work on a copy or save a recoverable version first.
Does the command distinguish uppercase and lowercase?
It generally treats values that differ only by letter case as duplicates. It also ignores visual formatting as a uniqueness rule. Check the retained records or use a separate comparison method if case distinctions are important to your task.
Is there a dedicated Mac shortcut?
The Windows Alt+A, M sequence is not a universal Mac shortcut. On Mac, use Data > Remove Duplicates and make the same header and column choices in the dialog.
Related
- Excel Day and Date Formats: Codes, Examples, and Fixes
- Excel Day and Month Reversed? Fixing Date Formats
- Excel WEEKDAY: Get the Day of the Week from a Date
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- VALUE Excel Cell Reference: Convert Text to NumbersIf A1 contains number-like text such as 42, enter =VALUE(A1) to convert it into the numeric value 42.…
- Excel Cell Adjustment Shortcut: Resize Rows and ColumnsIn Excel for Microsoft 365 on Windows, use Alt, H, O, I to AutoFit a column to its…
- Excel Header Drop-Downs: Add Filters or Choice ListsTo add a drop-down arrow for sorting or filtering, turn your data into an Excel table: select the…
- Excel Date Origin: 1900 vs. 1904 SystemsExcel’s default date origin on Windows is the 1900 date system: January 1, 1900 is serial number 1,…
- Excel Cell Height Limit: Maximum Row Height ExplainedIn Excel for Microsoft 365 on Windows, the maximum row height—and therefore the height of every cell in…
- Cut, Copy, and Paste in Excel: Shortcuts and StepsTo cut, copy, or paste in Excel for Microsoft 365 on Windows, select the cell or range and…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.