+ Reply to Thread
Results 1 to 2 of 2

compare two cells for controlled similarity

  1. #1
    Registered User
    Join Date
    07-01-2019
    Location
    Virginia
    MS-Off Ver
    Pro Plus 2016
    Posts
    22

    compare two cells for controlled similarity

    Hi all,

    how would I write a formula that can compare two cells and return true if 75% or more of the characters in the cells match in order.

    for example,
    cell B2 has length 24: "The cat in the black hat"
    cell C2 has: "4444cat in the black hzzzzdsaf"

    this would be considered similar because 18 of the 24 characters from B2 were present in C2, even with all the random text. however, "The cat in the blue hat" would not be similar even though 75% of original text is present, since there is a break in original string where black is swapped for blue. But, "The cat in the blank basket" would be considered similar since exactly 18 of the characters are the same and appear in the same order.

    My plan was to use find() for 75% of the characters in B2 starting at char1 and look in C2. Then starting at char2 and etc. But is there a more efficient way to do this?
    Like for my example, the formula would search for "The cat in the b" in C2, then search for "he cat in the bl", then "e cat in the bla" etc.

    Creating a new function in VBA would be fine also. Thanks

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: compare two cells for controlled similarity

    Hi,

    You might like to try the Excel Fuzzy Lookup Add-In here...
    https://www.microsoft.com/en-gb/down....aspx?id=15011

    I've used it occasionally for these sorts of things.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Compare addresses and show percentage of similarity.
    By fokeiro in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-13-2019, 02:26 PM
  2. I need help highlighting cells using a Text Similarity Calculation Formula
    By profiwriteraz in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-27-2015, 06:42 AM
  3. % similarity between 2 cells of text
    By guerillaexcel in forum Excel General
    Replies: 11
    Last Post: 03-12-2015, 06:58 PM
  4. [SOLVED] How to compare the similarity of 2 cells?
    By glux in forum Excel General
    Replies: 4
    Last Post: 07-29-2012, 03:42 AM
  5. Replies: 5
    Last Post: 02-07-2012, 07:16 AM
  6. Checking similarity of contents in two cells
    By fredykay in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 06-05-2011, 06:08 PM
  7. How to find similarity of cells?
    By zhshqzyc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-04-2011, 07:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1