Search for Duplicates in Excel: Quick and Easy Methods
In this article
To quickly search for duplicates in Excel, use the Conditional Formatting tool: select your data range, go to the Home tab, select Conditional Formatting > Highlight Cells Rules > Duplicate Values, and click OK. This immediately highlights every repeated entry in your chosen color, allowing you to see exactly where your data overlaps without deleting anything.
Managing duplicate data is a fundamental part of data cleaning. Whether you are dealing with a customer mailing list, an inventory spreadsheet, or a financial ledger, duplicate entries can lead to skewed calculations, double-billing, and inaccurate reporting. By using the built-in tools in Excel, you can either visually flag these errors for manual review or remove them entirely to ensure your dataset is lean and accurate. Depending on your goal—whether you just want to find them, count them, or delete them—Excel offers several different paths to achieve the result.
What You'll Need
- A computer with Microsoft Excel installed (works across Windows and macOS versions).
- A dataset containing the columns you wish to check for repetitions.
- A backup copy of your file (highly recommended before performing any mass deletions).
Step-by-Step
Depending on your specific needs, there are three primary ways to handle duplicates. Note that menu labels may differ slightly depending on your version of Excel or your regional settings.
Method 1: Highlighting Duplicates (Visual Search)
- Select your data: Click and drag your mouse to highlight the specific cells, columns, or rows you want to check. If you want to check the entire sheet, press Ctrl + A (Windows) or Cmd + A (Mac).
- Open Conditional Formatting: On the top ribbon, ensure you are on the Home tab. In the Styles group, click the Conditional Formatting button.
- Navigate to Highlight Rules: Hover over Highlight Cells Rules in the dropdown menu, then select Duplicate Values... from the side menu.
- Choose your formatting: A dialog box will appear. In the first dropdown, ensure "Duplicate" is selected. In the second dropdown, choose the highlight color (e.g., "Light Red Fill with Dark Red Text").
- Apply the rule: Click OK. Every cell that contains a value appearing more than once in your selection will now be colored.
Method 2: Removing Duplicates (Permanent Deletion)
- Select the data range: Click anywhere inside the data table you wish to clean.
- Access the Data Tools: Go to the Data tab on the top ribbon.
- Launch the tool: In the Data Tools group, click the Remove Duplicates button.
- Configure columns: A window will pop up asking which columns to check. If your data has headers (like "Email" or "Order ID"), make sure the My data has headers checkbox is checked.
- Select specific criteria: Uncheck the columns you don't care about. If you only want to remove rows where the Email is identical, leave only the "Email" column checked. If you want to remove rows only when every single column is identical, leave all columns checked.
- Execute: Click OK. Excel will tell you how many duplicate values were found and removed, and how many unique values remain.
Method 3: Using a Formula (For Advanced Tracking)
- Create a helper column: Insert a new blank column next to your data (e.g., Column B if your data is in Column A).
- Enter the COUNTIF formula: In the first cell of the helper column (B2), type
=COUNTIF(A:A, A2). This tells Excel to look at the entire column A and count how many times the value in cell A2 appears. - Fill the formula down: Click the small green square in the bottom-right corner of cell B2 and drag it down to the end of your list.
- Interpret the results: Any cell with a "1" is unique. Any cell with a "2" or higher is a duplicate.
- Filter the results: Go to the Data tab, click Filter, and use the dropdown in your helper column to select only numbers greater than 1.
Common Mistakes
One of the most frequent errors is failing to account for leading or trailing spaces. To Excel, "Apple" and "Apple " (with a space at the end) are different values. If your duplicate search isn't finding things that look identical, it is likely because of invisible whitespace. You can fix this by using the =TRIM() function on your data before searching.
Another common mistake is selecting only one column when you intend to find duplicates across a whole row. For example, if you have two customers named "John Smith" but they have different email addresses, highlighting only the "Name" column will mark them as duplicates. To avoid this, you must select all relevant columns and use the Remove Duplicates tool with all columns checked.
Lastly, users often forget to backup their data before using the Remove Duplicates tool. Unlike Conditional Formatting, which just changes the color, Remove Duplicates permanently deletes rows. While you can undo this immediately after the action (Ctrl + Z), if you save and close the file, those rows are gone forever.
Tips
To make your duplicate search more efficient, use Filter by Color. Once you have applied Conditional Formatting to highlight duplicates, click the Filter button in the Data tab. Click the filter arrow in the column header, select Filter by Color, and choose the highlight color. This collapses your list to show only the duplicates, making it much easier to audit them manually.
If you are working with a massive dataset (tens of thousands of rows), Conditional Formatting can sometimes slow down your computer because it recalculates in real-time. In these cases, the COUNTIF formula method or the Remove Duplicates tool is significantly faster and less taxing on your system's memory.
For those who want to keep the original list intact but create a separate, clean list elsewhere, use the UNIQUE function (available in Excel 365 and Excel 2021). Simply type =UNIQUE(A2:A100) in a blank cell, and Excel will automatically spill a list of only the unique values into the cells below.
Troubleshooting
If duplicates are not being highlighted: First, check for formatting inconsistencies. Ensure that your cells are all set to the same data type (e.g., all "Text" or all "Number"). If one "123" is stored as text and another "123" is stored as a number, Excel will not see them as duplicates. You can convert them by selecting the column, going to the Data tab, selecting Text to Columns, and clicking Finish immediately to reset the formatting.
If the Remove Duplicates tool deletes too much: This usually happens because the wrong columns were selected in the dialog box. If you only checked the "First Name" column, Excel will delete every person with the same first name, regardless of their last name. To fix this, undo the action immediately and restart the process, ensuring all columns that define a "unique" record are checked.
If the formula returns 1 for everything: Double-check your range. If you used =COUNTIF(A2, A2) instead of =COUNTIF(A:A, A2), you are only asking Excel to check the cell against itself, which will always result in 1. Ensure the first part of the formula refers to the entire column or the full range of your data.
Frequently Asked Questions
Can I find duplicates across two different sheets?
Yes, but not with Conditional Formatting. The easiest way is to use a VLOOKUP or MATCH formula on the second sheet to see if the value exists in the first sheet's range.
Does Excel distinguish between uppercase and lowercase letters?
No. By default, Excel's duplicate tools and the COUNTIF function are not case-sensitive. "APPLE" and "apple" are treated as the same value.
How do I highlight only the second or third occurrence, but keep the first one clean?
You cannot do this with the basic Duplicate Values rule. You must use a formula-based Conditional Formatting rule: =COUNTIF($A$2:A2, A2)>1. This counts occurrences from the top down, leaving the first instance unhighlighted.
Is there a way to search for duplicates in a specific row instead of a column?
Yes. The Remove Duplicates tool allows you to choose columns, but for highlighting, you simply select the row range instead of the column range before applying Conditional Formatting.
Can I find duplicates based on a partial match?
The standard tools only find exact matches. For partial matches, you would need to use wildcards (like asterisks) within a COUNTIF formula or use advanced Power Query transformations.