In Excel for Microsoft 365 on Windows, select a cell in your data and press Alt, then A, then M to open Remove Duplicates. Choose the columns that define a duplicate, confirm whether your data has headers, and select OK. Excel keeps the first matching record and removes later ones, so check the selection and consider making a copy before you begin.
What You’ll Need
- An Excel workbook with the list or table you want to clean up.
- A clear idea of what counts as a duplicate: an identical full row, or a repeated value in one or more specific columns.
- For important data, a backup copy of the sheet or workbook. Removing duplicates changes the selected data, so a copy gives you a safe way to restore the original.
Step-by-Step
- Review the data before removing anything. Check that each record is arranged in a row and that each field has its own column, such as Name, Email, and City. Look for blank rows, merged cells, or notes immediately beside the list. Excel works most predictably with a continuous rectangular range and a single header row. If the records are important, duplicate the worksheet first by right-clicking its sheet tab and choosing Move or Copy, then select Create a copy.
- Decide which columns identify a duplicate. If two records count as duplicates only when every field matches, include every column in the data. If the same email address should appear only once even when names or cities differ, use the email column as the criterion. This choice matters: Excel removes entire rows from the selected range based on the columns you check in the dialog. It does not merely clear duplicate cells.
- Select the data range. Click a cell inside one continuous list or Excel table. Excel will usually detect the surrounding data automatically when you open the command. For greater control, select the full range, including its header row if it has one. Include all columns that must stay together in the resulting records; selecting only one column can leave related information in adjacent columns untouched and misaligned.
- Open Remove Duplicates with the keyboard. Press and release Alt, then press and release A, then press M. This is a sequence, not three keys to hold down together. It opens the Remove Duplicates dialog from the Data tab in Excel for Microsoft 365 on Windows. If the sequence does not work because your Excel version, language, or ribbon setup uses different key tips, use the ribbon path Data > Remove Duplicates.
- Check the header setting. In the dialog, confirm whether My data has headers is checked. Leave it checked if the first row contains labels such as Email or Order ID; otherwise, uncheck it so the first record is included in the comparison. Excel may guess whether a header is present, so do not rely on the default without checking. A mistaken setting can cause a real record to be treated as a label or a label to be treated as data.
- Choose the columns for comparison. Use the checkboxes beside the column names. For complete-row duplicates, select all columns. To identify repeats by one field, select only that field. To define a match using a combination, select each relevant field—for example, Product and Store together. If the list has many columns, use Select All or Unselect All to adjust the choices, then verify the final checkboxes one by one.
- Run the removal and read the result. Select OK. Excel removes later records that match the chosen column combination and keeps the first matching record it encounters in the selected range. A message reports how many duplicate values were removed and how many unique values remain. Select OK again to close the message, then inspect the cleaned list rather than assuming the result is correct.
- Verify the rows that remain. Check several records that you expected to be duplicates and confirm that the intended version was kept. If the first occurrence is not the version you wanted to preserve, undo immediately with Ctrl+Z, sort the entire dataset so the preferred record comes first, and run Remove Duplicates again. Keep every field in the sort selection so values from different records do not get separated.
On a Mac, the Windows Alt key-tip sequence is not the equivalent shortcut. Use Data > Remove Duplicates from the ribbon or menu; available keyboard access can depend on your macOS and Excel settings. In Excel for the web, use the Data tab command if it is available in your version. The exact ribbon layout and shortcut behavior can differ from the Windows desktop app.
Common Mistakes
- Selecting too few columns. If you compare only names, Excel may treat two different people with the same name as duplicates. Conversely, including a field that changes on every row, such as a unique transaction number, prevents otherwise repeated records from matching. Choose columns that reflect the meaning of a duplicate in your list.
- Removing duplicate cells instead of duplicate records. The command deletes repeated rows from the selected range, not just the repeated value in the checked column. When a match is found, other selected fields in that row go with it. Make sure you are comfortable losing the whole repeated record.
- Leaving out adjacent columns. If your data spans A through F but you select only column A, Excel may remove entries in A without removing the corresponding information in B through F. Select the full record range, even when only one column determines whether a record is a duplicate.
- Getting the header checkbox wrong. A header is a label row, not a record. Check that Excel recognizes it as a header before confirming. If your first row is actual data, do not mark it as headers.
- Expecting Excel to clean up near-matches. Remove Duplicates is not a fuzzy matching tool. Extra spaces, spelling differences, and other inconsistencies can make two entries different. Standardize the data first if you need those variations treated as the same.
Tips
- Sort before removing duplicates when the retained version matters. Excel keeps the first match in the current order. If you want to retain the newest date, sort the entire dataset by date with the newest first, then remove duplicates using the appropriate ID or email column. Confirm that the sort includes all columns and the header setting is correct.
- Turn a regular range into a table for easier handling. Select a cell in the data and use Insert > Table, checking that the header option matches the range. Tables make it easier to work with named columns and help keep new rows within the dataset. Remove Duplicates is also available for table data.
- Use undo as an immediate recovery option. If the result is wrong and you have not made other changes since, press Ctrl+Z on Windows. On a Mac, use Command+Z. Undo may not be available after closing the workbook or after other actions, so a backup is more dependable for important records.
- Keep an untouched source when the process is recurring. If you regularly receive a new export, preserve the original data on a separate sheet and clean a copy. This makes it easier to compare the result, repeat the process, or correct a mistaken column choice without recreating the source.
- Check whether case or spaces explain a missed match. The command is not a full text-normalization tool. Differences such as leading or trailing spaces can stop values from matching, while capitalization alone may not distinguish otherwise identical entries. Standardize text consistently before deduplicating if those details matter to your task.
Troubleshooting
The Alt+A, M sequence does nothing. Press the keys one at a time rather than holding them down. Make sure Excel is the active window, then try the ribbon route Data > Remove Duplicates. Keyboard key tips can differ with localized Office installations, customized ribbons, or other Excel versions. If you use a Mac, use the Data command rather than expecting the Windows sequence to work.
Excel says it found no duplicates. Reopen the dialog and check whether the correct columns are selected. A unique ID column included by mistake will make nearly every row different. Also check for hidden spaces, inconsistent spellings, or values that look alike but are stored differently. You can inspect a few suspicious cells directly and standardize the source data before trying again.
Excel removed more rows than expected. You may have selected too few comparison columns, making distinct records appear identical according to the chosen fields. Press Ctrl+Z on Windows or Command+Z on Mac immediately if the removal is still the most recent action. Then reopen the dialog, include the fields needed to distinguish records, and check that the full row range is selected.
Information in neighboring columns no longer matches. The selected range may not have included the whole dataset. Undo if possible and select all columns belonging to each record before running the command again. If the workbook has unrelated information beside the list, do not include that information as part of the range; instead, select the complete record block only.
The wrong version of a record survived. Excel keeps the first matching record in the existing order; it does not choose the newest, most complete, or otherwise best version. Undo, sort the entire dataset so the version you want appears first, and repeat the command. If sorting would disrupt a meaningful order, make a copy and add a temporary priority field to help determine which record should come first.
Frequently Asked Questions
What is the keyboard shortcut to remove duplicates in Excel?
In Excel for Microsoft 365 on Windows, press and release Alt, then A, then M. It opens the Remove Duplicates dialog. If your key tips differ, use Data > Remove Duplicates.
Does Remove Duplicates keep the first or last entry?
It keeps the first matching record in the current order and removes later matches. Sort the full data range before running the command if a particular record should be kept.
Can I remove duplicates based on just one column?
Yes. In the dialog, check only that column to define a duplicate by that field, while selecting the full record range so the entire matching row is handled together.
Can I undo Remove Duplicates?
Usually, you can undo it immediately with Ctrl+Z on Windows or Command+Z on Mac. If you have done more work or closed the workbook, undo may not restore the original, so make a copy first when the data matters.
Does Remove Duplicates delete the whole row?
It removes duplicate records from the selected range, including the other selected fields in those rows. That is why you should select every column that belongs to the records, even if only one column is used to identify duplicates.
Is there a dedicated Mac shortcut?
The Windows Alt+A, M key-tip sequence does not apply as a standard Mac equivalent. On Mac, open the Data tab and choose Remove Duplicates; keyboard access may vary with your Excel and macOS settings.
Related
- Aggregate Excel Rows by Category, Product, or Date
- Excel SUBTOTAL: Does It Ignore Errors in Your Data?
- Excel SUBTOTAL AVERAGE: Average Filtered Data
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel Shortcut to the End of Data: Keys and LimitsIn Excel for Microsoft 365 on Windows, press Ctrl+Down Arrow to jump to the edge of the current…
- How to Find External Links in Excel and Check Their SourcesTo find external workbook links in Excel for Microsoft 365 on Windows, select Data > Workbook Links to…
- Excel Freeze Panes: Why the Option Is UnavailableIf Excel will not let you freeze panes, first press Esc to exit cell-editing mode, then click a…
- Excel Day of Year: Find the Day Number for Any DateTo find the day of the year in Excel, put a real Excel date in A2 and enter…
- Google Sheets Print Area: Set and Print a Cell RangeGoogle Sheets does not have a permanent, Excel-style “Set Print Area” command. To print just part of a…
- How to Add Footnotes at the End of a Page in Microsoft WordTo add a footnote at the bottom of a page in Microsoft Word, place the cursor after the…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.