+ Reply to Thread
Results 1 to 3 of 3

Formula needed to find best match

  1. #1
    Forum Contributor
    Join Date
    10-30-2010
    Location
    Kansas, USA
    MS-Off Ver
    Excel 2010
    Posts
    100

    Formula needed to find best match

    Please see the attached sheet.

    I want a formula to find the best (closest) match within a list and return and item code.

    Been searching all over the internet and haven't had any luck.

    It probably has to be a pretty complex formula for example i want to return "COKE DIET FREE" if the string is "Caffeine Free Diet Coke" or "Caffeine Free Coke Diet".

    I hope I explained it well enough....

    The worksheet kind of helps..

    Thanks in advance.
    Attached Files Attached Files
    Last edited by trickyricky; 03-05-2011 at 04:32 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula needed to find best match

    You could use a User Defined Function for this.

    Below is adapted from a solution to another post but based on your examples it should work ok... (apes your expected results)

    Please Login or Register  to view this content.
    The above, stored in a standard module in VBE, is invoked from a cell along the lines of other normal formulae - eg:

    Please Login or Register  to view this content.
    note: the code assumes (per sample) that codes are listed in order of length - ie Diet Pepsi after Pepsi, Diet Coke Free after Diet Coke and Diet Coke after Coke etc

  3. #3
    Forum Contributor
    Join Date
    10-30-2010
    Location
    Kansas, USA
    MS-Off Ver
    Excel 2010
    Posts
    100

    Re: Formula needed to find best match

    Gosh your good. Thanks for the super fast response you've saved me a lot of time and headache!

    I appreciate it!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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