How to Remove Duplicates in Excel 2 Columns
In this article
To remove duplicates in Excel when you have two columns (or more), the built-in Remove Duplicates tool is the fastest and most accurate method. It lets you choose which columns to check for duplicates, so you can keep rows that are unique in one column but duplicated in another. Here’s the step-by-step process, plus what to do when things don’t work as expected.
What You'll Need
- Microsoft Excel (desktop or web version) with your data already in a worksheet.
- Your data should be in a contiguous range — no completely empty rows or columns in the middle of the dataset.
- If your data has a header row, make sure it’s clearly labeled (e.g., “Name”, “Email”). Excel will use the first row as headers by default.
Step-by-Step
- Select your data range. Click and drag to highlight all cells that contain your data, including the header row if you have one. If your data is large, click the top-left cell, hold Shift, and click the bottom-right cell.
- Open the Remove Duplicates dialog. Go to the Data tab on the ribbon. In the Data Tools group, click Remove Duplicates. (In Excel for the web, it’s under the Data tab as well.)
- Check the “My data has headers” box if your first row is a header. If you don’t, Excel will treat the header as a regular row and might remove it if it’s duplicated.
- Choose which columns to check. In the dialog, you’ll see a list of all columns in your selection. By default, all are checked. To remove duplicates only when both columns match (e.g., same name AND same email), leave both checked. To remove duplicates based on only one column (e.g., keep first occurrence of each name), uncheck the other column(s).
- Click OK. Excel will scan the selected columns and remove any rows that have duplicate values in the chosen columns. It keeps the first occurrence and deletes the later ones.
- Review the result. A message will appear telling you how many duplicate values were removed and how many unique values remain. Click OK to dismiss it.
- Check your data. Scroll through to make sure the remaining rows are correct. If you removed duplicates based on one column, you may have lost data in the other column — that’s expected.
Note: Menu labels can vary slightly by Excel version and language, but the “Remove Duplicates” button is always under the Data tab in current versions.
Common Mistakes
- Selecting only one column when you meant to check both. If you highlight just column A, Excel will only look for duplicates in that column, even if you have data in column B.
- Forgetting to check “My data has headers” — this can cause your header row to be treated as a data row and possibly removed.
- Not selecting the entire data range — if you leave out columns, Excel will still remove rows, but it may shift data or leave orphaned values.
- Assuming “Remove Duplicates” keeps the last occurrence — it always keeps the first occurrence. If you need the last one, you’ll need to sort your data in reverse order first.
Tips
- Make a backup copy of your worksheet before removing duplicates, especially if you’re unsure about the result. You can copy the sheet by right-clicking its tab and choosing “Move or Copy”.
- Use a helper column if you need to combine two columns into one check. For example, in column C, enter
=A2&"-"&B2and drag down. Then use Remove Duplicates on column C only. - For case-sensitive duplicates, the standard Remove Duplicates tool treats “John” and “john” as different. If you need case-sensitive removal, use a formula with
EXACTor a pivot table. - If you want to highlight duplicates instead of removing them, use Conditional Formatting: select your range, go to Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values.
- After removing duplicates, check for blank rows — sometimes the removal leaves gaps. You can select the data and press Ctrl+G > Special > Blanks, then delete those rows.
Troubleshooting
If the Remove Duplicates button is grayed out: This usually means you have a filtered list or a table with merged cells. Clear any filters (Data > Clear) and unmerge any merged cells in the selected range.
If the tool removes rows you didn’t expect: Undo (Ctrl+Z) immediately. Then re-select your range and double-check which columns are checked. Also confirm that your data doesn’t have hidden blank rows or columns — Excel treats blanks as unique values, so a row with a blank cell might be kept even if other columns match.
If you get a message “No duplicates found” but you know there are: This can happen if the duplicates differ by invisible characters (like trailing spaces) or if the data is formatted differently (text vs number). Try using the TRIM function to clean spaces, or use the “Text to Columns” wizard to convert numbers to text (or vice versa) and try again.
If you need to remove duplicates from two columns but keep the row with the latest date: First sort your data by the date column (newest to oldest), then run Remove Duplicates on the other columns. Since it keeps the first occurrence, the newest row will be kept.
Frequently Asked Questions
Can I remove duplicates from two columns at once?
Yes. Select both columns (or the entire data range) and check both columns in the Remove Duplicates dialog. Excel will only remove a row if the combination of values in both columns appears more than once.
What if I want to remove duplicates based on only one column, but keep the data from the other column?
You can uncheck the other columns in the Remove Duplicates dialog. Excel will keep the first row for each unique value in the checked column, and it will keep the corresponding values from the unchecked columns.
Does Remove Duplicates work on Excel for Mac?
Yes, the same feature exists under the Data tab in Excel for Mac. The steps are identical.
Can I remove duplicates without losing the original data?
Yes. Either copy the data to a new sheet first, or use Conditional Formatting to highlight duplicates and then manually delete them. Alternatively, you can use a formula to extract unique values to a new location.
Why does my duplicate removal leave some duplicates behind?
This often happens when the duplicates have extra spaces or different number formats. Use the TRIM function to remove extra spaces, or convert all values to text (or number) before running Remove Duplicates.
Is there a way to remove duplicates in Excel without using the Data tab?
Yes. You can use Power Query (Get & Transform) to remove duplicates, or use a pivot table to list unique values. However, the Data tab method is the simplest for most users.