Excel TVExcelTV

How to Find & Highlight Duplicates in Excel

Updated
A spreadsheet illustration showing duplicate values highlighted in Excel

If you need the short version: use Conditional Formatting with a direct SUMPRODUCT equality formula to highlight duplicate values, then use Data > Remove Duplicates only after you’ve made a copy of the sheet. That gives you a fast visual check first and a safer cleanup second.

Excel Home tab showing the Duplicate Values conditional-formatting command and repeated cells highlighted for review

Key takeaways

Highlight duplicates, verify why each row matches, and remove records only from a copied sheet. Use Excel’s built-in rule for a quick one-column check, SUMPRODUCT equality for literal custom rules, fieldwise SUMPRODUCT with EXACT for case-sensitive multi-column records, and cleanup before comparison. This sequence keeps duplicate checks visible, testable, and reversible before any data is deleted.

  • Highlight duplicates first, remove them second. Seeing the pattern before deleting anything prevents accidental data loss.
  • Use direct equality for a literal custom rule. SUMPRODUCT does not send cell values through COUNTIF’s wildcard criteria parser.
  • Fieldwise SUMPRODUCT with EXACT is robust for multi-column matches. It preserves field positions and treats wildcard and delimiter characters as data.
  • Clean the text before you compare it. Extra spaces, invisible characters, and inconsistent case are the usual reasons duplicate checks feel “wrong.”
  • Keep the original sheet untouched. Copy the data or work in a duplicate workbook before removing anything.

Stat block: IBM’s data quality guide says poor data quality costs organizations an average of USD 12.9 million each year, and duplicate data is one of the problems that contributes to that cost. Source: IBM Think — “What is data quality?” (accessed 2026-07-10).

The fastest way to find duplicates in Excel

The fastest way to find duplicates is to select the target range and apply Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values. For a custom rule that excludes blanks or controls which copy is marked, use direct equality with SUMPRODUCT. Review the highlighted cells before changing or deleting the source data.

The phrase conditional formatting duplicates refers to this highlight-first workflow, which is also covered in the broader Excel conditional formatting guide and the walkthrough on how to color code in Excel.

Here’s the version I use most often for a single column of names, IDs, or email addresses:

  1. Select the data range, for example A2:A1000.
  2. Go to Home > Conditional Formatting > New Rule.
  3. Choose Use a formula to determine which cells to format.
  4. Enter this formula:
=SUMPRODUCT(--($A$2:$A$1000=A2))>1
  1. Pick a fill color and click OK.

That formula compares each cell directly with A2; it never turns the value into a COUNTIF criterion. As a result, literal ~, *, ?, and comparison-looking text such as >5 remain data, not wildcard or operator syntax. If the count is more than 1, Excel formats the cell. Direct Excel equality is case-insensitive, so MIA and Mia match; use EXACT when capitalization must distinguish records.

A couple of practical notes:

  • Lock the full range with $A$2:$A$1000.
  • Leave the criterion’s cell reference (A2) relative so Excel can evaluate each row correctly.
  • If your data extends beyond row 1000, expand the range or use a larger range than you expect to need.

A quick example you can verify

Suppose A2:A8 contains Mia, Leo, Mia, Noor, Leo, Ana, and Sam. With the rule applied to that range, both Mia cells and both Leo cells should be highlighted, while Noor, Ana, and Sam should remain unchanged. That result confirms two things: the selected range covers every record, and the formula is evaluating each row against the complete list.

Add one new Mia entry at the bottom. If it does not highlight, expand the rule’s Applies to range or convert the list to an Excel Table so new rows inherit the rule.

How to highlight duplicates in Excel with a formula

Use a custom SUMPRODUCT rule when you need more control than Excel’s Duplicate Values preset provides. The formula can mark every repeated value, ignore blanks, or highlight only the second occurrence onward. Keep the lookup range absolute and the row being evaluated relative. Direct equality avoids COUNTIF wildcard parsing and remains case-insensitive.

This Excel duplicate formula flags every repeated literal value:

=SUMPRODUCT(--($A$2:$A$1000=A2))>1

Use it when you want every repeated value to light up, including the first copy.

Use the first formula when you want to count duplicates as well as highlight them: a result greater than 1 means the current value belongs to a repeated-value group.

If you only want repeat occurrences to highlight, not the first instance, use a running range instead:

=SUMPRODUCT(--($A$2:A2=A2))>1

That version is especially useful when I’m cleaning a list and want to preserve the first record while flagging every later copy.

When I choose formula-based highlighting

I use formula-based highlighting when:

  • the built-in duplicate rule is too blunt,
  • I want a different format for first vs later matches,
  • I need to include or exclude blank cells,
  • or I’m comparing values across a custom range.

For example, if blank cells are triggering false positives in your sheet, you can exclude them with a slightly stricter rule:

=AND(A2<>"",SUMPRODUCT(--($A$2:$A$1000=A2))>1)

That tells Excel not to highlight empty rows while still treating ~, *, and ? as literal characters.

How to find duplicates across two or more columns

For a duplicate that depends on two or more columns, compare each source field independently with SUMPRODUCT and EXACT instead of joining values or passing them as wildcard-aware criteria. The fieldwise test preserves blank positions, treats * and ? literally, and cannot confuse data characters with a formula delimiter, so each comparison remains position-safe.

Suppose a row is only a duplicate when first name + last name + department all match. Apply this rule to the rows you want to highlight:

=AND(COUNTA($A2:$C2)>0,SUMPRODUCT(--EXACT($A$2:$A$1000,$A2),--EXACT($B$2:$B$1000,$B2),--EXACT($C$2:$C$1000,$C2))>1)

Apply the rule to the full row range, such as $A$2:$C$1000. The locked columns in $A2, $B2, $C2, and $A2:$C2 ensure that every formatted cell on a row evaluates that same row’s three defining fields instead of shifting the test right as Excel formats columns B and C. Each EXACT expression preserves field position and treats * and ? literally. EXACT is case-sensitive, so normalize case in helper columns first if capitalization should not distinguish records.

A better pattern for messy imported data

When I know the source file is messy, I normalize the text before I compare it:

=LOWER(TRIM(CLEAN(A2)))

That combination removes extra spaces, strips many invisible characters, and makes text comparisons case-insensitive.

If the match depends on several columns, clean each source field in its own helper column and point the fieldwise EXACT expressions at those cleaned columns. Keeping the fields separate preserves their positions and avoids delimiter or wildcard collisions.

How to highlight only the second copy and later copies

To highlight only the second and later copies, apply a running SUMPRODUCT rule whose lookup range starts at the first data row and expands to the current row. The first occurrence returns 1 and stays unformatted; each later occurrence returns more than 1 and receives the chosen format.

Use this conditional-formatting formula:

=SUMPRODUCT(--($A$2:A2=A2))>1

What it does:

  • The first time a value appears, the running count is 1, so nothing is highlighted.
  • The second time it appears, the count becomes 2, so Excel formats that row.
  • Every later repeat is also highlighted.

I like this approach when I’m reviewing a CRM export, an address list, or a lead sheet where the first instance should stay untouched.

If you’re using this on a large worksheet, keep the selected range tight. Conditional formatting is powerful, but it’s still a calculation rule, and unnecessarily large ranges can slow things down.

How to remove duplicates safely in Excel

Once you have highlighted repeated values and confirmed why they match, make a copy before using Data > Remove Duplicates. For the deletion choices and a fuller cleanup workflow, see how to remove duplicates in Excel; it explains how each selected column changes which rows Excel removes.

Use this workflow:

  1. Make a copy of the worksheet or the workbook.
  2. Select the data range.
  3. Go to Data > Remove Duplicates.
  4. Choose the columns that define a duplicate.
  5. Click OK.

That’s the safest path because Excel deletes rows immediately. If you’re not sure whether a column should be part of the comparison, copy the sheet and test on the duplicate version first.

My rule for choosing columns

I usually include only the fields that define true sameness.

For example:

  • A customer list might compare email address only.
  • An order list might compare order ID and line item ID.
  • A person list might compare first name, last name, and date of birth.

If you include too many columns, real duplicates slip through. If you include too few, you’ll delete rows that were actually distinct.

A better alternative for “keep everything, just unique values”

If you need a clean unique list without deleting anything from the source, use a separate sheet and extract unique values there. In many cases, that is a better workflow than modifying the raw data directly.

How to avoid false positives when Excel finds duplicates

To avoid false duplicate results, normalize imported text and confirm each column’s data type before applying the rule. TRIM removes surplus spaces, CLEAN handles many nonprinting characters, and LOWER standardizes case. Check blanks, merged cells, numbers stored as text, and date formats before trusting or acting on a match.

Here are the fixes I use most often:

1) Remove extra spaces

A trailing space makes two values look identical to the eye but different to Excel.

Use:

=TRIM(A2)

2) Strip non-printing characters

Imported CSVs and copied web data sometimes contain invisible characters.

Use:

=CLEAN(A2)

3) Normalize case

If you want case-insensitive matching, wrap the cleaned value in LOWER():

=LOWER(TRIM(CLEAN(A2)))

4) Check the data type

A number stored as text can behave differently from a number stored as a value. The same thing happens with dates.

If duplicate detection feels inconsistent, confirm the type before you compare the cells.

5) Watch for merged cells and formatted blanks

Merged cells and empty-looking cells with formatting can make the range hard to reason about. If the result looks strange, unmerge the sheet or copy the data into a clean range first.

How I handle duplicates when I’m comparing two lists

To find values that appear in both of two lists, test each value from the first list against the second with SUMPRODUCT. A result greater than zero means the value exists in both places. Put the formula in a comparison column so every match remains visible, reviewable, and easy to filter.

If you want a deeper comparison workflow, the Excel VLOOKUP compare two columns guide is a good companion read.

A simple duplicate check between two lists can look like this:

=SUMPRODUCT(--($B$2:$B$1000=A2))>0

That tells you whether the literal value in A2 exists anywhere in the second list, including values containing ~, *, or ?. The direct comparison is case-insensitive.

What I do after I find duplicates

After highlighting duplicates, classify each match as a true duplicate, a near duplicate, or a formatting-driven dirty duplicate. Delete only verified extra records, reconcile differing fields for near matches, and normalize dirty text before checking again. The classification determines the correct cleanup and prevents distinct records from being removed together.

  • True duplicate: same record entered more than once.
  • Near duplicate: same entity, but one field differs.
  • Dirty duplicate: same record, but with extra spaces, punctuation, or formatting noise.

That distinction matters because each one needs a different fix.

For true duplicates, I usually remove the extra rows. For near duplicates, I merge or reconcile the conflicting fields. For dirty duplicates, I clean the source text first and then run the duplicate check again.

After testing, you can unsort the sheet to return to the original order.

A quick pre-delete checklist

Before deleting duplicate rows, save a copy, confirm which columns define sameness, inspect blanks and dirty text, and record the expected row count. Then compare the before-and-after totals and document the rule used. This short audit trail gives you a rollback path and makes the cleanup understandable to collaborators.

  • Save a copy of the workbook first. A duplicate cleanup is only truly safe when you have a rollback path.
  • Confirm the comparison columns. Ask whether a duplicate is defined by one field or by a combination of fields.
  • Scan for blanks and dirty text. Empty rows, invisible spaces, and odd punctuation can make the result look wrong.
  • Sort or filter the data if it helps you review the pattern. Sometimes grouping identical values together makes the duplicate logic much easier to verify.
  • Check your counts before and after cleanup. If you expect 500 rows to stay and 20 to disappear, make sure the numbers match.

FAQ

The answers below cover the safest duplicate workflow, automatic highlighting, multi-column comparisons, and apparently identical values that fail to match. Each answer also anchors its guidance in a published Microsoft or IBM statistic, while the four visible questions mirror the four FAQ entries supplied to search engines in the page schema.

What is the easiest way to find duplicates in Excel?

Use Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values, then inspect every match before removing rows. IBM’s data-quality guide cites a Gartner estimate that poor data quality costs organizations an average of USD 12.9 million each year, which puts a measurable value on reviewing duplicate data carefully.

Can Excel highlight duplicates automatically?

Yes. Excel’s built-in Duplicate Values rule highlights repeated values after you apply it to a range. Microsoft specifies that a worksheet can contain 1,048,576 rows and 16,384 columns, so keep the rule’s applied range no larger than needed on a substantial sheet.

Can I find duplicates across multiple columns?

Yes. Use a fieldwise SUMPRODUCT and EXACT formula so each defining column stays in its original position and wildcard characters remain literal. Microsoft specifies that a worksheet can contain 16,384 columns, but compare only the fields that genuinely define one record.

Why does Excel think two values are different when they look the same?

Hidden spaces, nonprinting characters, or different data types are common causes. Microsoft says CLEAN targets the first 32 nonprinting characters in 7-bit ASCII, while six listed Unicode control values need additional cleanup, so normalize imported text before comparing it.

Written by

Allen Hoffman

Contributor, Excel TV

  • Lookup Functions
  • Data Manipulation
  • Keyboard Shortcuts
  • Workflow Efficiency
Allen Hoffman is a contributor to Excel TV focused on practical Excel techniques for everyday data work. His tutorials cover topics including lookup functions, data manipulation, cell formatting, keyboard shortcuts, and workflow efficiency. Allen's writing aims to make common Excel tasks clearer and faster, with step-by-step guidance suited to analysts and professionals who use Excel regularly in their work.

Read more articles by Allen Hoffman

Editorial standards

Fact Checking & Editorial Guidelines

Every article on Excel TV is held to a published editorial standard. The goal: accurate, current, and useful — without filler.

  1. Expert review.Drafts on technical Excel topics are reviewed by a contributor with hands-on, working knowledge of the feature being covered.
  2. Source validation.Claims about Excel behavior are tested in current Microsoft 365 builds. Third-party product claims are sourced from the vendor's own documentation.
  3. Disclosure.Affiliate links, sponsorships, and any commercial relationships that influenced a piece are disclosed in-line and at the foot of the article.
  4. Updates.Articles are revisited when Microsoft ships changes that affect the content. The most recent revision date is shown on every post.

Spot a problem? Email editor@excel.tv and we will look at it.

Subject-matter review

Reviewed by Subject Matter Experts

Technical Excel articles are reviewed by contributors with verifiable, hands-on experience in the topic — not generalist editors.

  • Qualified reviewers.Reviewers include Microsoft Excel MVPs, working business-intelligence practitioners, and Excel TV editorial staff. See each author's page for credentials.
  • Current to a known Excel build.Procedural articles state which Excel version they were validated against. Where Microsoft has since changed behavior, the article carries an inline update note.
  • Clarity check.Reviewers verify steps are reproducible by a reader at the assumed skill level — not just technically correct in a vacuum.

Want to contribute or review for Excel TV? See the about page.