Remove Duplicates Excel: 4 Methods That Actually Work

Remove duplicates in Excel using built-in tools, COUNTIF, Power Query, or formulas. Step-by-step guide with tips to avoid losing data.

Remove Duplicates Excel: 4 Methods That Actually Work

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.

What Counts as a Duplicate in Excel?

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.

Method 1: The Remove Duplicates Button (Fastest)

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.

Method 2: Highlight Duplicates with Conditional Formatting (Preview First)

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.

Method 3: COUNTIF Formula (Non-Destructive)

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.

Method 4: Power Query (Repeatable, Scalable)

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.

How to Remove Duplicate Rows Across Multiple Columns

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.

Removing Duplicates from a Single Column While Keeping All Rows

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.

Common Mistakes When Removing Duplicates

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.

Removing Duplicates vs. Keeping Unique Values: Which Do You Need?

These sound the same but they're different operations:

  • Remove duplicates = delete the extra rows, keep one copy of each value
  • Extract unique values = copy only the distinct values to a new location, leaving the original untouched

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.

Keyboard Shortcut for Remove Duplicates

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.

Using Remove Duplicates with Excel Tables

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.

Checking Your Work After Removing Duplicates

After you've run any deduplication method, it's worth verifying the result:

  • Check the row count before and after (look at the status bar at the bottom of Excel—it shows a count when you select cells)
  • Run a COUNTIF on your key column to confirm no values appear more than once
  • If you're working with a large dataset, pivot the key column and sort by count to spot any remaining duplicates

It only takes a minute and saves the embarrassment of delivering a report that still has duplicates in it.

Put Your Excel Skills to the Test

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.

Which Method Should You Use?

Here's a quick decision guide:

  • One-time cleanup, trust the data → Remove Duplicates button. Fastest, no fuss.
  • Want to review before deleting → Conditional Formatting to highlight, then COUNTIF to flag, then filter and delete.
  • Recurring monthly process → Power Query. Set it up once, refresh every month.
  • Need a unique list without deleting originals → UNIQUE function (365) or Advanced Filter.
  • Complex matching across columns → COUNTIF with a concatenated helper column, or Power Query with multi-column deduplication.

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.

Microsoft Excel - Microsoft Excel certification study resource

Final Thoughts

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.

About the Author

James R. HargroveJD, LLM

Attorney & Bar Exam Preparation Specialist

Yale Law School

James R. Hargrove is a practicing attorney and legal educator with a Juris Doctor from Yale Law School and an LLM in Constitutional Law. With over a decade of experience coaching bar exam candidates across multiple jurisdictions, he specializes in MBE strategy, state-specific essay preparation, and multistate performance test techniques.