+ Reply to Thread
Results 1 to 8 of 8

Lookup Partial Match of Characters

  1. #1
    Registered User
    Join Date
    01-17-2016
    Location
    Cal, USA
    MS-Off Ver
    2013
    Posts
    20

    Lookup Partial Match of Characters

    I am having a difficult time with a lookup that shows a partial match of character. I tried adding wild cards =VLOOKUP("*"&A1&"*",Sheet2!A:B,2,FALSE) on both sides, however, it does not seem to identify partial matches. A normal vlookup does not work as the data is not exact. I am basically trying to pull the day from table to and match it to the slightly different name from table 1. Example. BURTON, JAMES (1288) and Friday, MYERS, DERICK (0101) and Monday.

    Can you please help?

    table 1

    BURTON, JAMES (1288)
    MYERS, DERICK (0101)
    EBERHARD, RON (9330)
    MEADOWS, BEN (3958)
    MORGAN III, DANIEL (5535)
    RIVERA, JOE (6793)
    DEHAVEN, JOSH (1761)

    table 2

    BURTON, JAMES ------- Friday
    MYERS ------- Monday
    EBERHARD, RON ------- Tuesday
    MEADOWS, BEN ------- Tuesday
    MORGAN III, DANIEL ------- Tuesday
    RIVERA, JOE ------- Monday
    DEHAVEN, JOSH ------- Monday

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,369

    Re: Lookup Partial Match of Characters

    Instead of:

    "*"&A1&"*"

    try:

    LEFT(A1,FIND("(",A1)-2)

    If that doesn't work, attach a sample workbook.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,604

    Re: Lookup Partial Match of Characters

    The thing is, MYERS, DEREK in Table 1 wouldn't match with MYERS in table 2.

    Pete

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,369

    Re: Lookup Partial Match of Characters

    True - hadn't spotted that. We'd be better off with a samplw workbook.

  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 2403
    Posts
    43,893

    Re: Lookup Partial Match of Characters

    This DOES work with Myers, but surname alone may not be sufficient. If it isn't sufficient, then we have a problem... as in the case of Myers... there's nothing else to match!!

    =IFERROR(VLOOKUP(LEFT(A3,SEARCH(",",A3)-1)&"*",Sheet2!A:B,2,FALSE),"")
    Attached Files Attached Files
    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.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,604

    Re: Lookup Partial Match of Characters

    Here's an approach that works by finding the maximum length of a string that matches (by looking at 3, 4, 5, 6 and 7 characters) and then using that for the lookup value:

    =IFERROR(VLOOKUP(LEFT(A3,MAX(IF(COUNTIF(Sheet2!A:A,LEFT(A3,3)&"*"),3,0),IF(COUNTIF(Sheet2!A:A,LEFT(A3,4)&"*"),4,0),IF(COUNTIF(Sheet2!A:A,LEFT(A3,5)&"*"),5,0),IF(COUNTIF(Sheet2!A:A,LEFT(A3,6)&"*"),6,0),IF(COUNTIF(Sheet2!A:A,LEFT(A3,7)&"*"),7,0)))&"*",Sheet2!A:B,2,0),"")

    though it might be easier to follow if I lay it out like this:

    =IFERROR(VLOOKUP(LEFT(A3,MAX(
    IF(COUNTIF(Sheet2!A:A,LEFT(A3,3)&"*"),3,0),
    IF(COUNTIF(Sheet2!A:A,LEFT(A3,4)&"*"),4,0),
    IF(COUNTIF(Sheet2!A:A,LEFT(A3,5)&"*"),5,0),
    IF(COUNTIF(Sheet2!A:A,LEFT(A3,6)&"*"),6,0),
    IF(COUNTIF(Sheet2!A:A,LEFT(A3,7)&"*"),7,0)))
    &"*",Sheet2!A:B,2,0),"")

    the 3 to 7 characters are arbitrary, but could be extended for as many characters as you like. You could probably reduce the multiple-IFs by using an array formula. I used Glenn's attachment (saves me typing it up from scratch) and put the formula in cell D3 then copied it down.

    Hope this helps.

    Pete

  7. #7
    Registered User
    Join Date
    01-17-2016
    Location
    Cal, USA
    MS-Off Ver
    2013
    Posts
    20

    Talking Re: Lookup Partial Match of Characters

    Thank you all!!

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

    Re: Lookup Partial Match of Characters

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please select "Thread Tools" from the menu link (just above the first post in the thread) and mark this thread as SOLVED.

+ 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. Partial Match - Mac characters match
    By Prascena in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-06-2021, 09:40 PM
  2. [SOLVED] Partial match of first N characters conditional formating
    By wolf1438 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-17-2018, 02:33 AM
  3. [SOLVED] Lookup partial values and if match return partial value from another cell
    By Renejorgensen in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-01-2017, 07:53 AM
  4. [SOLVED] Index Match with Partial Match in Lookup Array
    By AliGW in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-22-2016, 03:13 PM
  5. [SOLVED] Partial Match Lookup
    By bjnockle in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-15-2015, 02:24 AM
  6. Replies: 5
    Last Post: 02-24-2011, 11:26 AM
  7. [SOLVED] partial lookup/match
    By myra_deV in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-09-2006, 10:25 AM

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