Duplicates

How to Find and Highlight Duplicates in Excel

By the DecodingPro teamUpdated 3 min read

Quick answer

Select the column, then Home, Conditional Formatting, Highlight Cells Rules, Duplicate Values. To mark only the repeats and keep the first occurrence, put =COUNTIF($A$2:A2,A2)>1 in a helper column: it returns TRUE from the second appearance onward. Nothing is deleted, so you can review before you remove anything.

Deleting duplicates is permanent and easy to get wrong. Finding them first costs a minute and shows you what you would lose. This guide covers finding, marking and counting duplicates. When you are ready to delete, see removing duplicates in Excel without losing data.

Method 1: highlight with conditional formatting

  1. Select the column (click the column letter).
  2. Choose Home, Conditional Formatting, Highlight Cells Rules, Duplicate Values.
  3. Pick a colour and click OK.

Every cell whose value appears more than once is coloured, including the first one. The comparison ignores upper and lower case, so Anna@x.com and anna@x.com count as the same.

Method 2: mark the repeats and keep the first

In a helper column next to your data:

=COUNTIF($A$2:A2,A2)>1

The range grows as you fill down, so the first appearance gives FALSE and every later one gives TRUE. Filter the helper column for TRUE to see only the extra copies.

To label them instead:

=IF(COUNTIF($A$2:A2,A2)>1,"Repeat","")

Method 3: count how often each value appears

=COUNTIF($A$2:$A$5000,A2)

Sort or filter this column for values above 1. A count of 3 means the value occurs three times in total.

Method 4: duplicates across several columns

Two people with the same last name are not duplicates; the same first name, last name and email probably are. Use COUNTIFS with every column that must match:

=COUNTIFS($A$2:$A$5000,A2,$B$2:$B$5000,B2,$C$2:$C$5000,C2)>1

Method 5: list them (Microsoft 365 and Excel 2021)

To list each duplicated value once:

=UNIQUE(FILTER(A2:A5000,COUNTIF(A2:A5000,A2:A5000)>1))

Older versions of Excel do not have UNIQUE and FILTER; use the helper column from Method 2 and a filter.

Why Excel misses duplicates that you can see

Excel compares exactly. These all look the same to you and different to Excel:

Looks likeWhat differsFix before comparing
John Smith and John Smith A trailing spaceTRIM
Smith and smithCase (only in some tools)LOWER
1234 and "1234"A number versus textMake both text or both numbers
Acme Inc and Acme Inc.PunctuationStandardise with SUBSTITUTE
A. Lee and Anna LeeDifferent spelling of the same personNeeds a human decision

Create a helper column with the clean version, for example =LOWER(TRIM(A2)), and run the duplicate check on that column.

Tip: two rows are duplicates only if they stand for the same real thing. Before deleting, compare the other columns: the second row may hold a newer phone number or address worth keeping.

Warning: COUNTIF treats * and ? as wildcards and cannot compare text longer than 255 characters. For long text or values that contain those characters, use a helper column that builds a short key.

A whole file at once

DecodingPro flags duplicate rows and duplicate IDs and lists them in the notes column, so you decide what to keep instead of having rows deleted without telling you.

Try it on your own file

You start with 100 free credits. Every change is logged, and anything unclear is flagged, never guessed.

Fix a spreadsheet

Questions people ask

How do I highlight the whole row when one column is a duplicate?

Select your data, choose Conditional Formatting, New Rule, Use a formula, and enter =COUNTIF($A:$A,$A2)>1. The dollar sign before A keeps the check on column A for every cell in the row.

Can I find duplicates between two sheets?

Yes. Use =COUNTIF(Sheet2!$A:$A,A2)>0 to mark values that also exist on the other sheet, or see comparing two lists in Excel.

Does conditional formatting find duplicates in large files?

It works, but it slows a sheet with tens of thousands of rows. A helper column with COUNTIF is easier to filter and to sort.

Keep reading

01Excel data cleaningHow to Clean Messy Excel Data: A Step-by-Step GuideThe fixed order that stops one fix from undoing another, with the formulas for every step.10 min read02Text and numbersHow to Keep Leading Zeros in Excel and CSV (ZIP Codes, IDs)Why Excel turns 02134 into 2134, how to get the zeros back, and how to stop it happening when you open a CSV.5 min read03CSV and importsHow to Clean a CSV File Before Importing It Into a CRMSeven fixes that prevent duplicate contacts, rejected rows and scrambled characters, and the 10-row test to run first.4 min read04DatesHow to Fix Dates in Excel and CSV Files (Mixed Formats)Text dates, day-month swaps, two-digit years and the one rule that makes dates safe to share.8 min read05Phone numbersHow to Fix Phone Numbers in Excel: Format and Country CodesLeading zeros, 9.19E+11, country codes and the international format that every system accepts.6 min read06DuplicatesHow to Remove Duplicates in Excel Without Losing DataExact, near and partial duplicates: decide what counts, mark before you delete, keep the best record.6 min read08NamesHow to Standardize Names in Excel: Proper Case and ExceptionsWhat PROPER gets wrong, how to protect names that are already right, and how to flip "Smith, John" into "John Smith".4 min read09Email addressesHow to Fix Email Typos in Excel: gmial.com, .con and Missing @The typos that make campaigns bounce, and the formulas and checks that fix them without guessing.4 min read10Email addressesHow to Clean an Email List Before You Send a CampaignA five-step routine that removes the avoidable bounces from a list without deleting anyone you should keep.3 min read11NamesHow to Split Full Names into First and Last Name in ExcelFlash Fill, Text to Columns and formulas for splitting names, and the names that trip each one up.4 min read12Text cleanupHow to Remove Extra Spaces in Excel (TRIM, CLEAN and Non-Breaking Spaces)Why TRIM sometimes does nothing, and the one formula that removes every kind of stray space.3 min read13Text cleanupHow to Remove Special Characters and Line Breaks in ExcelThe characters you cannot see, the smart quotes you can, and the exact formula or shortcut that removes each one.4 min read14NumbersHow to Convert Text to Numbers in Excel (Numbers Stored as Text)Why sums show zero, why numbers sit on the left, and four ways to turn text back into real numbers.3 min read15Excel data cleaningHow to Clean Data with Power Query in Excel (Step by Step)Record your cleaning steps once and replay them on every new file, without formulas and without touching the original data.4 min read16Comparing dataHow to Compare Two Lists in Excel and Find What Is MissingFind the names, IDs or emails that are in one list and not the other, with formulas that scale.3 min read17CSV and importsFix Garbled Characters and Broken CSV Imports (UTF-8)UTF-8, delimiters, leading zeros, quotes and a checklist that makes a file safe to import.7 min read18Data entryData Entry Accuracy: How to Check, Measure and Improve ItWhat the research says about error rates, why proofreading fails and the checks that actually work.9 min read