+ Reply to Thread
Results 1 to 11 of 11

Percentage match

  1. #1
    Registered User
    Join Date
    10-11-2019
    Location
    Nottingham
    MS-Off Ver
    MS Office
    Posts
    70

    Percentage match

    Hello Guys,

    I have always used Vlookup and returned the exact value but this time i am struck.

    I am in a situation where in i would like to lookup value in Column A Sheet 1 in Column A in Sheet 2 and return the percentage match value

    for example if Column A sheet 1 has

    Apple
    Pear

    Column A Sheet 2 has
    Aple
    Pear

    I would like the results to be some thing like in Column B Sheet 1

    Apple 99%
    Pear 100%
    Attached Files Attached Files
    Last edited by ismailshajji; 11-16-2020 at 06:55 PM.

  2. #2
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Percentage match

    ummmm.....i think you gave use the wrong data in col a, sheet 2. were those supposed to be %ages?

  3. #3
    Registered User
    Join Date
    10-11-2019
    Location
    Nottingham
    MS-Off Ver
    MS Office
    Posts
    70

    Re: Percentage match

    Quote Originally Posted by vba_php View Post
    ummmm.....i think you gave use the wrong data in col a, sheet 2. were those supposed to be %ages?
    thank you so much for taking you time.

    i have attached original data to my original post.
    I am trying to check if the cell values of sheet 1 are present in column 1 of sheet 3 using vlookup and if it is present then i would like to return the percentage match as the return value.

    i was looking at the forumn and came across this Levenshtein but not sure how to implement it .

  4. #4
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Percentage match

    Quote Originally Posted by ismailshajji View Post
    if it is present then i would like to return the percentage match as the return value..
    what do you mean percentage match? that has nothing to do with the cols of data you provided. the only thing one can do is use vlookup to see if data exists in one col based on the other col. or are you trying to detect whether strings are similar? as in: one string is inside of the other somewhere? that's the only thing I can think of that you can possibly mean.

    see attached workbook for all that can be given to you at this point, given the info that you posted. is the APPROX vlookup() match col in the book what you're looking for?
    Attached Files Attached Files

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Percentage match

    How do you want the percentage match calculated (provide a manually calculated example)?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  6. #6
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,477

    Re: Percentage match

    I was thinking like vba_php that it looks like you want some kind of string similarity algorithm. Levenshtein distance is one such algorithm (my internet search pulled this up: https://itnext.io/string-similarity-...gi=b4d06d1be3a ).

    To my knowledge, Excel does not have any of these "string similarity" algorithms pre-programmed in. A quick internet search for "levenshtein distance excel" found some interesting possibilities:
    A stackoverflow q&a that has a javascript(?) udf (for use in google sheets, though I understand that the newest versions of Excel are transitioning to using javascript as a macro language, so it might be useful in that context). It also has a google sheets worksheet formula only approach that should be easily downloaded into Excel: https://stackoverflow.com/questions/...g-to-resort-to

    From our forum, this sample sheet includes a VBA UDF that claims to use a weighted Damerau-Levenshtein algorithm: https://www.excelforum.com/excel-gen...ml#post3431918

    A VBA module on github: https://gist.github.com/draffensperger/7176944

    Assuming it is string similarity you are trying to do and Levenshtein is an acceptable algorithm, see if any of that helps.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  7. #7
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Percentage match

    not sure if anything that advanced will be that well received, Shorty. hmmmmmm

  8. #8
    Registered User
    Join Date
    10-11-2019
    Location
    Nottingham
    MS-Off Ver
    MS Office
    Posts
    70

    Re: Percentage match

    Quote Originally Posted by vba_php View Post
    not sure if anything that advanced will be that well received, Shorty. hmmmmmm
    Brother thank you so much for your help. I work in hospital and have been really busy and haven't had a chance to visit the forum.

    Thank you for attaching the test data file with the formulas, I can see that the approximate match is actually getting the closer results but in the row below.

    What i am trying to do is i have a data of Equipment models in sheet 1 that i would like to see if they are present in sheet 2, exact match can find any thing that is true but there are some models that are codes with different spellings and i would like to count all the alphabets in sheet 1 Cell and compare the data on sheet 2 and get a percentage anything that is 100% is exact match anything that is over 95 % should be ok and i should be able to correct them manually.

    I hope the above explanation is ok, but if its bit difficult its ok i will manually check them and correct it .

    Regards,

  9. #9
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Percentage match

    Quote Originally Posted by ismailshajji View Post
    i would like to count all the alphabets in sheet 1 Cell and compare the data on sheet 2 and get a percentage anything that is 100% is exact match anything that is over 95 % should be ok
    you can't get that with any excel functions. you will have to write code. and that in itself will be overly complicated. sorry.

  10. #10
    Registered User
    Join Date
    10-11-2019
    Location
    Nottingham
    MS-Off Ver
    MS Office
    Posts
    70
    Quote Originally Posted by vba_php View Post
    you can't get that with any excel functions. you will have to write code. and that in itself will be overly complicated. sorry.
    Oh ok thank you.

  11. #11
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,477

    Re: Percentage match

    you can't get that with any excel functions. you will have to write code.
    Did either of you have a look at the spreadsheet that I mentioned in this link? https://stackoverflow.com/questions/...g-to-resort-to
    It seems to manage a Levenshtein distance algorithm for up to 15 character strings without any code. Expanding to longer strings should only require some strategic copy/paste to expand the matrix to whatever size you need (up to the spreadsheet's limit of 16000 columns). Assuming that Levenshtein distance is an adequate measure of string similarity for the OP, it seems to accomplish the task.

+ 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. IF Partial Fuzzy Match then Calculate Percentage
    By CHRISOK in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-20-2017, 05:04 PM
  2. Replies: 1
    Last Post: 09-20-2016, 07:33 PM
  3. Lookup, match and index to return percentage to table to draw a radar chart
    By smudgepost in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-26-2014, 11:31 AM
  4. Macro needed to match columns and calculating percentage using Excel
    By genetist in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-12-2013, 02:20 AM
  5. [SOLVED] Match the percentage on one sheet and fill the column with the name match
    By gigi79 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-18-2012, 11:52 AM
  6. Compare words between two cells for percentage match
    By lkuchel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-22-2010, 07:06 PM
  7. Replies: 3
    Last Post: 07-27-2010, 05:10 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