Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel Duplicates: How to Find and Remove Them

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To run duplicates in Excel, you can either highlight them using Conditional Formatting or delete them entirely using the Remove Duplicates tool. Highlighting is best for reviewing data before deletion, while the Remove Duplicates tool is the fastest way to clean a dataset. Depending on your version of Excel, menu labels may differ slightly, but the core functionality remains consistent across Windows and macOS.

What You'll Need

  • A computer with Microsoft Excel installed (Office 365, Excel 2021, 2019, or 2016).
  • A dataset containing the information you wish to analyze for repetitions.
  • A backup copy of your data (strongly recommended before performing permanent deletions).

Step-by-Step

There are two primary ways to handle duplicates: identifying them visually or removing them automatically. Follow the specific method that fits your goal.

Method 1: Highlighting Duplicates (Visual Audit)

  1. Open your Excel workbook and select the specific range of cells, column, or row you want to check for duplicates. To select an entire column, click the letter header at the top of the column.
  2. Navigate to the Home tab on the top ribbon.
  3. In the Styles group, click on Conditional Formatting.
  4. Hover your mouse over Highlight Cells Rules, then select Duplicate Values... from the side menu.
  5. A dialog box will appear. In the first dropdown menu, ensure Duplicate is selected. In the second dropdown, choose your preferred formatting style (e.g., "Light Red Fill with Dark Red Text").
  6. Click OK. All cells containing repeated values will now be colored, allowing you to manually inspect them before deciding which ones to keep or delete.

Method 2: Removing Duplicates (Permanent Deletion)

  1. Click any single cell within the data range you want to clean. This tells Excel where the data table begins and ends.
  2. Go to the Data tab on the top ribbon.
  3. In the Data Tools group, click the Remove Duplicates button.
  4. A dialog box titled "Remove Duplicates" will open. You will see a list of all columns in your selected range.
  5. Check the box My data has headers if your top row contains titles (like "Email" or "Order ID"). This prevents Excel from treating your headers as data.
  6. Select the columns you want Excel to check.
    • If you select only one column, Excel deletes any row where that specific column has a repeat.
    • If you select multiple columns, Excel only deletes a row if the values in all selected columns are identical to another row.
  7. Click OK. Excel will display a summary message telling you how many duplicate values were found and removed, and how many unique values remain.

Method 3: Using a Formula (Advanced Tracking)

  1. Create a new helper column next to your data.
  2. In the first cell of the helper column, enter the formula =COUNTIF(A:A, A2) (assuming your data is in column A and you are starting at row 2).
  3. Press Enter and drag the fill handle down to apply the formula to all rows.
  4. Any cell with a number greater than 1 is a duplicate. You can then use the Filter tool (Data > Filter) to show only rows with a value of 2 or higher.

Common Mistakes

One of the most frequent errors is failing to back up data before using the Remove Duplicates tool. Unlike Conditional Formatting, which only changes the color of a cell, Remove Duplicates permanently deletes rows. If you realize later that you needed a specific piece of information from a "duplicate" row (perhaps a different timestamp or a subtle variation in a note), that data is gone unless you have a backup or use the Undo command immediately.

Another common mistake is selecting the wrong combination of columns. Users often select every column in the sheet when they only intended to check for duplicates based on a unique identifier, such as an Email Address or ID Number. If you select all columns, Excel will only remove a row if every single cell in that row is an exact match of another row. If a customer signed up twice but used a different phone number the second time, selecting all columns will not catch that duplicate, whereas selecting only the Email column would.

Ignoring leading or trailing spaces is a third major pitfall. Excel treats "John Doe" and "John Doe " (with a space at the end) as two completely different values. To the human eye, they look identical, but the software sees different character strings. This leads to "ghost duplicates" that the Remove Duplicates tool will ignore.

Tips

To solve the spacing issue mentioned above, use the TRIM function before running your duplicate check. Create a temporary column and use =TRIM(A2) to remove all unnecessary spaces from your text. Copy the results and use Paste Values to overwrite your original data before running the duplicate tools.

If you want to keep a record of what was deleted, use the Formula Method (COUNTIF) instead of the Remove Duplicates tool. By marking duplicates with a number, you can filter them, review them, and then manually delete them or move them to a separate "Archive" sheet. This provides an audit trail that the automated tool does not offer.

For very large datasets, Conditional Formatting can slow down your computer's performance because Excel must constantly recalculate the formatting for every cell. If your sheet feels laggy, clear the rules (Conditional Formatting > Clear Rules > Clear Rules from Entire Sheet) and switch to the Remove Duplicates tool or a Pivot Table to summarize your data.

Troubleshooting

If the Remove Duplicates tool says "No duplicate values found" but you can clearly see repetitions, the most likely cause is inconsistent formatting. Check for hidden characters, non-breaking spaces (often found in data imported from the web), or differences in capitalization if you are using a case-sensitive plugin (though standard Excel is generally not case-sensitive for this tool).

If the tool deletes more data than expected, check your column selections in the Remove Duplicates dialog box. You may have accidentally checked a column that contains generic values (like "Status: Active") which caused Excel to see many rows as identical. Ensure you are only checking the columns that truly define a unique record.

If the Remove Duplicates button is greyed out, ensure that your worksheet is not protected. Go to the Review tab and check if it says Unprotect Sheet. If the sheet is protected, you cannot modify the data structure, including removing duplicates. You will need the password to unprotect the sheet before the tool becomes available.

If you are using Excel Online (the web version), some advanced Conditional Formatting options may be limited compared to the desktop application. If a specific highlight rule is missing, open the file in the desktop app by clicking Editing > Open in Desktop App.

Frequently Asked Questions

Does Remove Duplicates delete the entire row?

Yes, when you use the Remove Duplicates tool, Excel deletes the entire row associated with the duplicate value, not just the cell in the column you selected.

Can I find duplicates across two different sheets?

The built-in Remove Duplicates tool only works on a single contiguous range. To find duplicates across two sheets, you should copy the data from both sheets into one long list on a new sheet and then run the duplicate tools.

Is there a way to highlight only the second occurrence of a duplicate?

Standard Conditional Formatting highlights all copies of a duplicate. To highlight only the second or third occurrence, you must use a custom formula in Conditional Formatting, such as =COUNTIF($A$2:A2, A2)>1.

Does Excel consider uppercase and lowercase letters as duplicates?

For the Remove Duplicates tool and basic Conditional Formatting, Excel is not case-sensitive. "APPLE" and "apple" are treated as the same value.

How do I remove duplicates but keep the newest entry?

Excel's Remove Duplicates tool always keeps the first instance it encounters and deletes subsequent ones. To keep the newest entry, sort your data by date (Newest to Oldest) first, then run the Remove Duplicates tool.