Identify Duplicates in Excel: 3 Easy Ways to Find Dupes
In this article
To identify duplicates in Excel, the fastest method is using Conditional Formatting: select your data range, go to Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values, and click OK. This instantly highlights every repeating entry in a chosen color, allowing you to visually audit your dataset before deciding whether to keep, merge, or delete the redundant information. This process is essential for cleaning mailing lists, auditing financial records, or ensuring a database doesn't have overlapping entries that could skew your analysis.
What You'll Need
- A computer with Microsoft Excel installed (works on Office 365, Excel 2021, 2019, and 2016).
- A dataset containing the columns you wish to check for repeating values.
- A backup copy of your file (recommended before performing bulk deletions).
Step-by-Step
Method 1: Highlighting Duplicates with Conditional Formatting
This is the best method for visual identification. It doesn't remove anything; it simply flags the data so you can investigate why the duplicates exist.
- Open your Excel workbook and navigate to the worksheet containing your data.
- Select the specific range of cells you want to check. You can click and drag to select a column, or click the letter at the top of the column (e.g., Column A) to select the entire vertical range. Note that menu labels may differ slightly depending on your version of Excel or region.
- On the top ribbon, click the Home tab.
- In the Styles group, click Conditional Formatting.
- Hover your mouse over Highlight Cells Rules and then select Duplicate Values... from the side menu.
- A dialog box will appear. In the first dropdown, ensure Duplicate is selected. In the second dropdown, choose your preferred formatting style (e.g., "Light Red Fill with Dark Red Text").
- Click OK. All cells containing values that appear more than once in your selection will now be highlighted.
Method 2: Using the UNIQUE Function (Excel 365 and 2021)
If you want to create a separate, clean list of unique values without touching the original data, the UNIQUE function is the most efficient tool.
- Click on an empty cell where you want the cleaned list to begin.
- Type the formula
=UNIQUE(. - While the parenthesis is open, click and drag to select the range of cells you want to filter for duplicates (for example, A2:A100).
- Close the parenthesis
)and press Enter. - Excel will automatically "spill" a list of only the unique values into the cells below. Any duplicate entries from the original list are ignored in this new output.
Method 3: Counting Occurrences with COUNTIF
When you need to know exactly how many times a value repeats (rather than just knowing that it does), a helper column with a formula is the professional approach.
- Insert a new blank column next to the data you are analyzing. Label it "Count" or "Duplicates".
- In the first data cell of this new column (e.g., cell B2), type the formula:
=COUNTIF(A:A, A2). In this example,A:Arefers to the entire column being checked, andA2is the specific cell the formula is checking for. - Press Enter. The result will be a number. A "1" means the value is unique; any number greater than 1 indicates a duplicate.
- Hover your mouse over the bottom-right corner of cell B2 until the cursor becomes a small black cross (the fill handle). Double-click the cross to flash-fill the formula down to the bottom of your dataset.
- (Optional) To make these easier to find, select your new count column, go to Data > Filter, and filter the column to show only values greater than 1.
Common Mistakes
One of the most frequent errors is ignoring trailing spaces. Excel treats "Apple" and "Apple " (with a space at the end) as two different values. If your duplicates aren't being highlighted, it is often because of invisible whitespace. To fix this, you can use the =TRIM() function on your data before running a duplicate check.
Another common mistake is selecting the header row when using Conditional Formatting. If your header is "Email Address" and you have another cell later in the sheet that accidentally says "Email Address," Excel will highlight both. Always select only the data rows, or be mindful that headers might be flagged.
Users also frequently confuse "Identifying" with "Removing." The Remove Duplicates tool (found under the Data tab) is permanent and deletes the row entirely. If you only wanted to see the duplicates to verify them, using the Remove tool without a backup can lead to irreversible data loss.
Tips
To quickly group your highlighted duplicates together, use the Sort feature. After applying Conditional Formatting, right-click one of the highlighted cells, select Sort, and then choose Put Selected Cell Color On Top. This pushes all duplicates to the top of your sheet for easy review.
If you are working with very large datasets (tens of thousands of rows), Conditional Formatting can slow down your computer's performance because it recalculates in real-time. In these cases, the COUNTIF method or using a Pivot Table is significantly faster and more stable.
For multi-column duplicate checks (e.g., finding rows where both the First Name AND Last Name are identical), the Remove Duplicates tool is best. When you open Data > Remove Duplicates, you can check multiple boxes to ensure Excel only flags rows where every selected column matches exactly.
Troubleshooting
If duplicates are not being highlighted: Check for formatting inconsistencies. A number stored as text (indicated by a small green triangle in the corner of the cell) will not be seen as a duplicate of the same number stored as a numeric value. Use the Text to Columns tool under the Data tab to convert the entire column to a consistent format.
If the UNIQUE function returns a #SPILL! error: This happens when there are existing values in the cells where the function is trying to place the results. Clear all cells below and to the right of your formula cell to give the function enough room to display the list.
If the COUNTIF formula is returning 1 for everything: Ensure your range is locked if you aren't using whole-column references. If you used =COUNTIF(A2:A100, A2) and dragged it down, the range shifted to A3:A101, A4:A102, and so on. Use absolute references: =COUNTIF($A$2:$A$100, A2).
Frequently Asked Questions
Can I identify duplicates across two different sheets?
Yes, but not with Conditional Formatting. The best way is to use =VLOOKUP or =MATCH. For example, =MATCH(A2, Sheet2!A:A, 0) will return a number if the value in A2 exists on Sheet2, and an #N/A error if it does not.
Does Excel consider uppercase and lowercase letters as duplicates?
No. By default, Excel is not case-sensitive. "DATA" and "data" are treated as the same value. If you need a case-sensitive check, you must use a formula involving the =EXACT() function.
How do I remove the highlighting after I've fixed the duplicates?
Select the range, go to Home > Conditional Formatting > Clear Rules, and select Clear Rules from Selected Cells.
Can I highlight only the second or third occurrence of a duplicate?
Yes, by using a custom formula in Conditional Formatting. Instead of the default "Duplicate Values" rule, select Use a formula to determine which cells to format and enter =COUNTIF($A$2:A2, A2)>1. This only highlights the value if it has already appeared once above the current cell.
Is there a way to identify duplicates in a whole table at once?
Yes, select the entire table range before applying Conditional Formatting. However, this will highlight any value that repeats anywhere in the table, even if it's in a different column. For row-by-row duplicates, use the Remove Duplicates dialog to identify them first.