+ Reply to Thread
Results 1 to 17 of 17

Use VLookup to search for multiple variation of a name

  1. #1
    Forum Contributor
    Join Date
    04-28-2016
    Location
    Stavanger, Norway
    MS-Off Ver
    365
    Posts
    142

    Use VLookup to search for multiple variation of a name

    I am currently attempting to get VLookup to look for multiple variations of a name. For example, I have a list with names and values. By using VLookup I wish to find the value for either X-16/16-X/X 16/ 16 X, only 1 of these will be in the table at one point so Im thinking it would be great if I somehow could get VLookup to search for all of them in 1 single formula.

    See attached example

    Please advice
    Attached Files Attached Files

  2. #2
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Use VLookup to search for multiple variation of a name

    Hey can you put some more examples ??? It would easy to workaround
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  3. #3
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Use VLookup to search for multiple variation of a name

    Hi,

    =LOOKUP(1,0/COUNTIF(E2:E5,A9:A11),B9:B11)

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  4. #4
    Forum Contributor
    Join Date
    04-28-2016
    Location
    Stavanger, Norway
    MS-Off Ver
    365
    Posts
    142

    Re: Use VLookup to search for multiple variation of a name

    Thanks for quick reply, why "1,0/"? The formula does not seem to work here, Im getting #DIV/0!

  5. #5
    Forum Contributor
    Join Date
    04-28-2016
    Location
    Stavanger, Norway
    MS-Off Ver
    365
    Posts
    142

    Re: Use VLookup to search for multiple variation of a name

    Thanks for quick reply, I have uploaded some more examples. So the clue here is to look for multiple similar name corresponding to whatever is in the list by using the alternative name list
    Attached Files Attached Files

  6. #6
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Use VLookup to search for multiple variation of a name

    May be try

    B2=IFERROR(VLOOKUP(INDEX($E$2:$E$11,MATCH(A2,$E$2:$E$11,0)+1),$A$9:$B$12,2,0),VLOOKUP(A2,$A$9:$B$12,2,0))

  7. #7
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Use VLookup to search for multiple variation of a name

    But how do we know which of the entries in the Alternative Lookup names list is associated with a given search entry?

    You might be able to tell by sight that, for the entry in cell A2 ("X-16"), for example, we should use the four options "16X", "X16", "X-16" and "16-X" from the Alternative Lookup names list, but what logic can we use to tell Excel to use these four only? This is bordering on 'fuzzy' matching, which is extremely problematic. As such, this is most likely only going to be achievable if you can give more strict rules regarding which 'variations' of a given search term should be considered, e.g. for a given entry search in the Alternative Lookup names list for:

    1) That entry
    2) That entry with the hyphen removed
    3) That entry with the characters in reverse order
    ...
    etc.

    Regards

  8. #8
    Forum Contributor
    Join Date
    04-28-2016
    Location
    Stavanger, Norway
    MS-Off Ver
    365
    Posts
    142

    Re: Use VLookup to search for multiple variation of a name

    Quote Originally Posted by XOR LX View Post
    But how do we know which of the entries in the Alternative Lookup names list is associated with a given search entry?

    You might be able to tell by sight that, for the entry in cell A2 ("X-16"), for example, we should use the four options "16X", "X16", "X-16" and "16-X" from the Alternative Lookup names list, but what logic can we use to tell Excel to use these four only? This is bordering on 'fuzzy' matching, which is extremely problematic. As such, this is most likely only going to be achievable if you can give more strict rules regarding which 'variations' of a given search term should be considered, e.g. for a given entry search in the Alternative Lookup names list for:

    1) That entry
    2) That entry with the hyphen removed
    3) That entry with the characters in reverse order
    ...
    etc.

    Regards
    What If I just have 1 list per variation, so all the X16 variations is in its own list?

  9. #9
    Forum Contributor
    Join Date
    04-28-2016
    Location
    Stavanger, Norway
    MS-Off Ver
    365
    Posts
    142

    Re: Use VLookup to search for multiple variation of a name

    Quote Originally Posted by shukla.ankur281190 View Post
    May be try

    B2=IFERROR(VLOOKUP(INDEX($E$2:$E$11,MATCH(A2,$E$2:$E$11,0)+1),$A$9:$B$12,2,0),VLOOKUP(A2,$A$9:$B$12,2,0))
    This does not seem to work for me, does it work for you?

  10. #10
    Forum Contributor
    Join Date
    04-28-2016
    Location
    Stavanger, Norway
    MS-Off Ver
    365
    Posts
    142

    Re: Use VLookup to search for multiple variation of a name

    New example with separated alternative name lists (see attached)
    Attached Files Attached Files

  11. #11
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Use VLookup to search for multiple variation of a name

    Quote Originally Posted by mss90 View Post
    What If I just have 1 list per variation, so all the X16 variations is in its own list?
    Yes, that would work. Or, better still, you could have a single list with all variations to consider for a given entry, e.g.:

    Name Alternative Lookup Names
    X-16 16X
    X-16 X16
    X-16 X-16
    X-16 16-X
    C1 C1
    C1 1C
    A1 A1
    A1 1A
    B1 B1
    B1 1B

    Can you attach a workbook with some new examples to that effect?

    Regards

  12. #12
    Forum Contributor
    Join Date
    04-28-2016
    Location
    Stavanger, Norway
    MS-Off Ver
    365
    Posts
    142

    Re: Use VLookup to search for multiple variation of a name

    Quote Originally Posted by XOR LX View Post
    Yes, that would work. Or, better still, you could have a single list with all variations to consider for a given entry, e.g.:

    Name Alternative Lookup Names
    X-16 16X
    X-16 X16
    X-16 X-16
    X-16 16-X
    C1 C1
    C1 1C
    A1 A1
    A1 1A
    B1 B1
    B1 1B

    Can you attach a workbook with some new examples to that effect?

    Regards
    Yeah I did think about that already but as this is a part of a huge excel workbook that solution will cause a lot of issues "downstream". Is it not possible to just have a list with alternative names?

  13. #13
    Forum Contributor
    Join Date
    04-28-2016
    Location
    Stavanger, Norway
    MS-Off Ver
    365
    Posts
    142

    Re: Use VLookup to search for multiple variation of a name

    What about using double VLookup (See attached excel spreadsheet).

    So first run a Vlookup to find the ID/Name thats has been used. Then paste that findings by ignoring the N/A cells into another VLookup to find the corresponding value. Would that work? Im not sure how to get copy the finding og the first Vlookup tho
    Attached Files Attached Files

  14. #14
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Use VLookup to search for multiple variation of a name

    Quote Originally Posted by mss90 View Post
    Yeah I did think about that already but as this is a part of a huge excel workbook that solution will cause a lot of issues "downstream". Is it not possible to just have a list with alternative names?
    But we still need separate lists for each of the search terms, no, as per your latest example? The way I've laid it out is no different in terms or quantity of entries, yet in terms of facilitating the required formula set-up it's an enormous improvement.

    Regards
    Last edited by XOR LX; 09-03-2020 at 05:52 AM.

  15. #15
    Forum Contributor
    Join Date
    04-28-2016
    Location
    Stavanger, Norway
    MS-Off Ver
    365
    Posts
    142

    Re: Use VLookup to search for multiple variation of a name

    So is it not possible then to just have a synonym list and do Vlookup on multiple different names?

  16. #16
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Use VLookup to search for multiple variation of a name

    Of course. That's what my list was! As was yours - my only wish would be to have the list in the format I gave rather than yours.

    Regards

  17. #17
    Forum Contributor
    Join Date
    04-28-2016
    Location
    Stavanger, Norway
    MS-Off Ver
    365
    Posts
    142

    Re: Use VLookup to search for multiple variation of a name

    Alright cheers. I cant have that list due to the setup of my spreadsheet, its not going to work I'm afride.

+ 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. Variation of VLOOKUP that returns all partial matches
    By anthonyle in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 03-14-2013, 12:40 AM
  2. Variation of VLOOKUP that returns ALL matches, not just the first one...
    By Leicester in forum Excel - New Users/Basics
    Replies: 12
    Last Post: 03-14-2013, 12:34 AM
  3. variation on VLookup or Index function
    By dododave in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 09-25-2012, 02:05 PM
  4. Replies: 12
    Last Post: 01-10-2008, 09:34 AM
  5. Variation of Vlookup?
    By PradeepRed in forum Excel General
    Replies: 1
    Last Post: 12-04-2007, 08:48 AM
  6. Vlookup/hlookup variation
    By jmtomasz in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-29-2007, 04:57 AM
  7. VLOOKUP variation?
    By JChandler22 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-27-2007, 05:06 PM
  8. Column Matching and Colouring (VLookUp variation?)
    By Dogbert in forum Excel General
    Replies: 5
    Last Post: 10-31-2006, 01:08 PM

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