+ Reply to Thread
Results 1 to 8 of 8

Lookup Partial Match of Characters

Hybrid View

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

    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

  2. #2
    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!!

+ 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. 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