HomeGoogle DocsSpreadsheetHighlight Partial Matching Duplicates in Google Sheets

Highlight Partial Matching Duplicates in Google Sheets

Quick Answer:
To highlight partial matching duplicates in Google Sheets, use this custom formula in conditional formatting:

=ArrayFormula(
   LET(
      range, $B$2:$B$15, 
      cell, B2, 
      test1, COUNT(IFERROR(SEARCH(cell, range))), 
      test2, COUNT(IFERROR(SEARCH(IF(range="", NA(), range), cell))), 
      test3, cell<>"", 
      AND(OR(test1>1, test2>1), test3)
   )
)

What Are Partial Matching Duplicates?

Partial matching duplicates occur when one value fully or partially exists within another value.

Example:

  • A-101
  • A-101 Rev. 00
  • A-101 Rev. 01

All of the above should be treated as duplicates because they share the same base value.

However, Google Sheets does not provide a built-in rule to highlight such matches—only exact duplicates.

Why Simple Formulas Fail

A common attempt is:

=AND(B2<>"", COUNTIF($B$2:$B$15, "*"&B2&"*")>1)

Problem:

  • Only highlights base values (e.g., A-101)
  • Fails to highlight revisions (A-101 Rev. 00)
  • Can produce false matches in mixed text datasets

Best Formula to Highlight Partial Matching Duplicates

Use this formula:

=ArrayFormula(
   LET(
      range, $B$2:$B$15, 
      cell, B2, 
      test1, COUNT(IFERROR(SEARCH(cell, range))), 
      test2, COUNT(IFERROR(SEARCH(IF(range="", NA(), range), cell))), 
      test3, cell<>"", 
      AND(OR(test1>1, test2>1), test3)
   )
)
Example showing partial matching duplicates highlighted in Google Sheets

Why This Works

  • Matches both directions:
    • cell inside range
    • range inside cell
  • Avoids false positives from blanks
  • Highlights all related entries, not just the first

How to Apply the Rule

  1. Select your data range (e.g., B2:B15)
  2. Go to Format > Conditional formatting
  3. Choose Custom formula is
  4. Enter the formula above
  5. Choose a formatting style
  6. Click Done
Custom rule settings for partial matches in the Conditional Format panel in Google Sheets

How the Formula Works (Simple Explanation)

The formula uses three logical checks:

  • Search current cell in the range → finds larger matches
  • Search range values inside current cell → finds base matches
  • Ignore blank cells

If either match count is greater than 1, the value is considered a duplicate.

Important Note (Avoid False Positives)

Consider these values:

  • A-101 – Architectural Floor Plan (Level 1)
  • A-101 – Architectural Floor Plan (Level 2)

These are not true duplicates, even though they look similar.

But these are duplicates:

  • A-101
  • A-101 – Architectural Floor Plan (Level 2)

👉 If your data includes structured text, consider:

When to Use This Method

Use this approach when:

  • You have codes with revisions
  • Data contains partial overlaps
  • Exact duplicate rules are not sufficient

Conclusion

This tutorial is part of The Ultimate Guide to Conditional Formatting in Google Sheets, where you can explore 80+ practical examples, including advanced duplicate detection, custom rules, and real-world use cases.

If you frequently work with versioned data or mixed text values, mastering partial match highlighting can significantly improve data analysis and cleanup.

Related Tutorials

Prashanth K V
Prashanth K V
Your Trusted Google Sheets and Excel Expert Prashanth K V is a Diamond Product Expert in Google Sheets, officially recognized by Google for his contributions to the Docs Editors Help Community and featured in the Google Product Experts Directory. Explore his blog to learn advanced formulas, automation tips, and problem-solving techniques to elevate your spreadsheet skills.

Top Discussions

More like this

How to Build a Road Trip Fuel Cost Splitter Formula in Google Sheets

Need a fair formula to split fuel costs among travelers on a long road...

Road Trip Fuel Cost Splitter in Google Sheets (Free Template)

When you go on a long road trip with friends, splitting fuel expenses fairly...

Savings Tracker Template in Google Sheets (Free Download)

Managing multiple savings goals can become difficult without a proper system to track your...

11 COMMENTS

  1. Hi,

    Is there a way to highlight cells with ANY 5 matching letters, regardless of where they are in the cell, and ignoring LEFT or RIGHT?

    • Hi, Moe,

      Try this rule.

      =counta(unique(split(regexreplace(regexreplace(C2,"[^abcpq]",""),".", "$0,"),","),1))=5

      Replace C2 with the corresponding cell reference and “abcpq” with your choice of letters.

  2. Hi,

    Is there a way to highlight different address variations?

    Ex.
    335 S Los robles ave
    335 south Los robles ave

    2603 RAE DELL AVE APT 1
    2603 RAE DELL AVE # 1

    57 Westland ave apt A
    57 Westland Ave Unit 1

  3. Hi, I am trying to adapt this function to the right side of a string of numbers in google docs.

    But when I change the function to RIGHT instead of LEFT, it does nothing. Any suggestions?

  4. Hi!

    I know, in Excel, you can do this.

    But, can Google Sheet apply a conditional format to a partial text in a cell? NOT to the entire cell, only a portion of the text inside the cell (the one that matches the rule).

    Thanks!

  5. I have one column with date, next with event names, last is with names.

    How to highlight duplicate names (last column) by 1st and 2nd columns using conditional formatting in google sheets?

  6. Is there a way to match the contents of the cell for all but the last four characters of one? (e.g., “Image D53” and “Image D53.png”?

    • Hi, Melinda Campbell,

      It’s possible! In my example below, the value “Image D53.png” is in cell G6. Let’s see how to match as per your requirement of leaving the last 4 characters from this value.

      =match("Image D53",left(G6,len(G6)-4))>0

      The LEFT and LEN combination returns the value trimming 4 characters from the end of the string in cell G6.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.