Shortcuts, iPhone, AI & small business
Keyboard shortcuts

Remove duplicates in Excel: the Alt, A, M shortcut and three safer ways

Click in your list and press Alt, A, M to open Remove Duplicates in Excel. Choose the columns that define a duplicate, highlight duplicates before deleting, keep the original list with UNIQUE, and avoid the common mistakes.

By The Applio team4 min read

6-second videoRemove duplicates in Excel with Alt, A, MClick in the list, press Alt, A, M and Enter. Excel deletes the repeated rows and reports how many it removed.A new shortcut every week. Follow us:YouTube · TikTok · Instagram · Facebook · Pinterest

The keyboard shortcut for Remove Duplicates in Excel is Alt, then A, then M, pressed one after another on Windows. Click any cell in your list first. Excel opens the Remove Duplicates dialog; press Enter to compare all columns and delete the repeated rows. A message tells you how many duplicates were removed and how many unique rows remain.

Excel for Mac has no key sequence for it. Use Data, Remove Duplicates on the ribbon.

Quick reference

What you want How
Open Remove Duplicates Alt, A, M (Windows) or Data, Remove Duplicates
Highlight duplicates without deleting Home, Conditional Formatting, Highlight Cells Rules, Duplicate Values (Alt, H, L, H, D)
List unique values with a formula =UNIQUE(A2:A100) in Microsoft 365 and Excel 2021 or later
Count how often a value appears =COUNTIF(A:A,A2)
Undo the removal Ctrl + Z

What Remove Duplicates does

It keeps the first row of each group of duplicates and deletes the later ones. The rows are deleted for good, not hidden, and the remaining rows move up.

In the dialog you choose which columns decide whether two rows are the same:

  • All columns ticked: a row is removed only if every cell matches another row. This is the safe default.
  • One column ticked, for example Email: every later row with the same email is removed, even if the name or phone number differs. Useful for a mailing list, risky for anything else.

Tick My data has headers if the first row holds column names, otherwise the header is treated as data.

Look before you delete

Removing rows is quick to do and easy to regret. Two habits keep you safe.

Highlight first. Select the column, then go to Home, Conditional Formatting, Highlight Cells Rules, Duplicate Values. Every repeated value turns red. Scroll through them and check that they are real duplicates and not two different people with the same name.

Work on a copy. Right-click the sheet tab, choose Move or Copy, tick Create a copy. Run Remove Duplicates on the copy and keep the original until you are sure.

Keep the original and build a clean list

In Microsoft 365 and Excel 2021 or later, the UNIQUE function gives you a list without duplicates and leaves the source alone:

  • =UNIQUE(A2:A100) returns each value once.
  • =UNIQUE(A2:C100) returns each distinct row.
  • =SORT(UNIQUE(A2:A100)) returns them in alphabetical order.

The result updates when the source changes, which Remove Duplicates never does. In older versions use Data, Advanced (in the Sort & Filter group), tick Unique records only and choose Copy to another location.

Why Excel misses some duplicates

Remove Duplicates compares what is in the cells exactly, except for upper and lower case. These look the same to you but not to Excel:

  • Extra spaces. "Anna Smith" and "Anna Smith " with a space at the end are different. Clean them with =TRIM(A2) in a helper column, then paste the results back as values.
  • Numbers stored as text. 1042 as a number and "1042" as text do not match. Convert the column with Data, Text to Columns, Finish.
  • Different formats of the same thing. "+387 61 123 456" and "061123456" are different strings. Flash Fill with Ctrl + E can bring a column into one format before you compare.
  • Invisible characters from web pages or PDFs. =CLEAN(TRIM(A2)) removes most of them.

Case is ignored: "anna@mail.com" and "ANNA@MAIL.COM" count as duplicates.

Common mistakes

  • Selecting one column inside a wider list. Excel asks whether to expand the selection. If you continue with the current selection, duplicates are removed from that column only and the cells shift up, which scrambles every row. Choose Expand the selection.
  • Filtering first. Remove Duplicates works on the whole range, including rows hidden by a filter.
  • Expecting the best row to survive. Excel keeps the first one it meets. Sort the list first so the row you want to keep, such as the newest date, is on top.

Google Sheets

In Google Sheets go to Data, Data cleanup, Remove duplicates. The UNIQUE function works the same way as in Excel. More in our Google Sheets shortcuts.

Common questions

Is there a single-key shortcut for Remove Duplicates?

No. Alt, A, M is a ribbon key sequence: Alt opens the key tips, A opens the Data tab and M runs the command. You can add the command to the Quick Access Toolbar and run it with Alt + its position number.

Does Remove Duplicates delete the first or the last occurrence?

It keeps the first occurrence and deletes the rest.

How do I count duplicates without removing them?

Put =COUNTIF(A:A,A2) next to the list and fill it down with Ctrl + D. Any result above 1 is a repeated value.

Remove Duplicates sits next to the other clean-up keys in our Excel shortcuts cheat sheet, with a free printable PDF. To clear out the leftover empty rows afterwards, see the delete row shortcut.

Written by

The Applio team

We build booking software for appointment-based businesses: the Applio platform and the BarberSamir app on the App Store. We write about the tools and habits that save us time. More about us

Keep reading

Shortcuts

AutoSum shortcut in Excel: Alt + = adds up a column for you

Click the cell under your numbers and press Alt + = to insert a SUM formula in Excel. Sum several columns at once, add row totals, sum only visible rows, and fix AutoSum when it picks the wrong range or returns 0.

· 5 min read

Shortcuts

Excel shortcut for today's date: Ctrl + ; (and the time)

Press Ctrl + ; to type today's date into an Excel cell and Ctrl + Shift + ; for the current time. Mac keys, date and time in one cell, filling many cells at once, TODAY() vs the shortcut, and fixes when it does nothing.

· 6 min read