Duplicate data is one of the most common headaches in Excel. Whether you're working with a customer list, a sales report, or a raw data import, duplicates slip inâand they skew your totals, inflate your row counts, and make your spreadsheets unreliable. The good news? Excel gives you four solid ways to deal with them, and one of them takes about ten seconds.
This guide walks you through every method: the built-in Remove Duplicates button, COUNTIF-based filtering, Power Query for repeatable cleanup, and advanced formulas for keeping the first occurrence only. You'll also learn how to highlight duplicates before deleting themâso you know exactly what you're removing.
Before you start deleting, it's worth being precise. A duplicate row means every value in the selected columns matches another row exactly. A partial duplicate means only some columns match. Excel's Remove Duplicates tool lets you choose which columns to checkâso you can define âduplicateâ to fit your data.
For example, a customer list might have two rows for âJohn Smithâ at different email addresses. That's not a true duplicate. But two rows with the same email? That's one you probably want to remove.
This is the method most people learn first, and for good reasonâit's built right into the Data tab and handles most cases in a few clicks.
Step 1: Click anywhere inside your data range or table. You don't need to select the whole column.
Step 2: Go to the Data tab on the ribbon.
Step 3: Click Remove Duplicates in the Data Tools group.
Step 4: A dialog box appears listing all your columns. Check the boxes for the columns you want Excel to compare. If you only care about duplicates in Column A, uncheck everything else.
Step 5: Click OK. Excel deletes the duplicate rows and tells you how many were removed and how many unique values remain.
That's it. Excel keeps the first occurrence and deletes all subsequent ones. This is permanentâthere's no undo list after you close the dialog, so save a backup first or use Ctrl+Z immediately if something looks wrong.
When to use it: Quick one-time cleanup where you trust the data and just need duplicates gone fast.
Limitation: It's destructive. You can't preview which rows will be deleted, and it doesn't work well when you need to keep duplicates visible for review.
If you want to see the duplicates before removing them, use Conditional Formatting. This lets you visually audit your data first.
Step 1: Select the column or range you want to check.
Step 2: Go to Home â Conditional Formatting â Highlight Cells Rules â Duplicate Values.
Step 3: Choose a highlight color and click OK. Excel immediately colors all duplicate cells.
Now you can scroll through and decide which ones to remove. Once you're confident, you can use Remove Duplicates or filter and delete manually.
This method works best for smaller datasets where visual review makes sense. For thousands of rows, you'll want a formula-based approach.
The COUNTIF approach lets you flag duplicates in a helper column without touching your original data. You can then filter and delete only what you want.
Step 1: Add a new column next to your dataâcall it âDuplicate Checkâ or similar.
Step 2: In the first data row of that column, enter this formula (assuming your data is in Column A starting at row 2):
=COUNTIF(:A2, A2)
Step 3: Copy this formula down through all your rows.
This formula counts how many times the current cell's value has appeared so far. The first time a value appears, it returns 1. The second time, it returns 2âand so on. Any value greater than 1 is a duplicate.
Step 4: Filter the column to show only values greater than 1, then delete those rows.
Why use this over the built-in button? Because you control exactly what gets deleted. You can review every row flagged as a duplicate before removing anything. It's also great for vlookup excel workflows where you're cross-referencing multiple sheets.
If you're cleaning duplicate data regularlyâlike a monthly importâPower Query is the right tool. You set up the steps once and run them again every time new data comes in.
Step 1: Select your data range or table.
Step 2: Go to Data â Get & Transform Data â From Table/Range. If prompted, confirm that your data has headers.
Step 3: The Power Query Editor opens. Select the columns you want to deduplicate (hold Ctrl to select multiple).
Step 4: Right-click a selected column header and choose Remove Duplicates.
Step 5: Click Close & Load to output the cleaned data to a new sheet.
Power Query keeps every transformation step in a log. Next month, when you paste new data into your source table, just right-click the query and hit Refreshâit runs the same deduplication automatically.
This method is especially powerful when combined with excel formulas for more complex data transformation pipelines.
Sometimes a âduplicateâ only makes sense when two or more columns match together. For example, the same customer name can appear twice legitimately if they have two different order numbersâbut if both the name and the order number match, that's a duplicate.
The Remove Duplicates button handles this well. When the dialog opens, just check both columns. Excel will only delete rows where all selected columns match simultaneously.
With COUNTIF, you'd concatenate the columns first:
=COUNTIF(:D2, D2)
Where Column D contains a formula like =A2&\_\&B2 that joins your key columns together. Any duplicate in this combined key gets flagged.
Sometimes you don't want to delete entire rowsâyou just want to extract a unique list from one column. There are two clean ways to do this.
Option A: Advanced Filter
Go to Data â Sort & Filter â Advanced. Check âCopy to another location,â specify where to paste, and check âUnique records only.â Click OK. Excel copies only the unique values to your chosen destination.
Option B: UNIQUE function (Excel 365 / Excel 2021+)
In a blank cell, type =UNIQUE(A2:A100). Excel spills a unique list automatically. This is dynamicâif your source data changes, the list updates too.
The UNIQUE function is one of Excel's newer dynamic array functions. If you're on an older version, Advanced Filter is your best alternative.
A few things catch people out the first time:
Trailing spaces. âJohn Smithâ and âJohn Smith â (with a trailing space) look identical but aren't. Excel treats them as different values. Fix this by running TRIM on your data first: =TRIM(A2), paste-as-values, then remove duplicates.
Capitalization mismatches. Excel's Remove Duplicates is case-insensitive, so âEXCELâ and âexcelâ count as duplicates. But COUNTIF is also case-insensitive by default. If case matters to you, use EXACT in your formula instead.
Not backing up first. The Remove Duplicates button is permanent. Always copy your data to another sheet before running itâespecially on data you imported from elsewhere.
Removing duplicates from headers. Make sure your range includes headers and that the âMy data has headersâ checkbox is ticked. Otherwise, Excel might treat your header row as data and delete it.
These sound the same but they're different operations:
The built-in Remove Duplicates button does the first. Advanced Filter and the UNIQUE function do the second. Know which one you need before you startâit saves a lot of confusion.
For anyone preparing for a Microsoft certification, you'll also want to know how to merge cells in excelâanother common task covered in the MOS exam objectives.
There isn't a single-key shortcut, but you can navigate there fast with Alt keys:
Alt â A â M opens the Remove Duplicates dialog directly from the Data tab.
Once you're in the dialog, Tab and Space let you check/uncheck columns, and Enter confirms. Quick enough for regular use without touching the mouse.
If your data is formatted as an Excel Table (Ctrl+T), Remove Duplicates works the same wayâjust click anywhere in the table and go to Data â Remove Duplicates. The table will automatically resize after rows are deleted.
One advantage of tables: they make it easier to reference your data dynamically in formulas. If you're using excel formula references that point to a table column, they'll update automatically when duplicates are removed.
Tables also play well with Power Queryâthey're the recommended input format if you're building a repeatable cleanup pipeline.
After you've run any deduplication method, it's worth verifying the result:
It only takes a minute and saves the embarrassment of delivering a report that still has duplicates in it.
Removing duplicates is a core data-cleaning skillâand it comes up in Excel certification exams. If you're preparing for the MOS exam or just want to test your knowledge, working through practice questions locks in the concepts faster than reading alone.
Here's a quick decision guide:
Most users end up using the built-in button 90% of the time. But knowing the COUNTIF and Power Query methods means you're covered for the cases where the simple button isn't enough.
If you're working with large datasets, you might also find the excel freeze row feature helpfulâkeeping headers visible while you scroll through thousands of rows makes cleanup much easier.
And if you're dealing with duplicates in excel from regular data imports, setting up a Power Query connection to your source file means your data's clean the moment it lands in Excelâno manual step required.
Removing duplicates in Excel doesn't have to be stressful. The built-in button handles most cases in secondsâbut knowing the COUNTIF method and Power Query gives you control when you need it. Start with the simplest approach that fits your situation, verify your results, and keep a backup until you're confident in the output.
The more you work with data in Excel, the more you'll appreciate having these techniques ready. Clean data leads to accurate formulas, trustworthy reports, and a lot fewer late-night fire drills when the numbers don't add up.