+ Reply to Thread
Results 1 to 5 of 5

Lookup/Find Prefixes in Range

  1. #1
    Registered User
    Join Date
    07-13-2012
    Location
    USA
    MS-Off Ver
    Excel 365
    Posts
    7

    Lookup/Find Prefixes in Range

    I have the two tables below.

    Prefixes
    PN
    SN
    DN

    Values Valid
    PN001 T
    PA123 F
    SN654 T

    I am trying to determine if my value in the second table has the proper prefix in it which are defined in the first table and if so then indicate that the value is valid. I have looked at the FIND, VLOOKUP, MATCH, etc to see if I can find something to work and I am drawing a complete blank. Basically I was hoping for something like this =FIND(B3:B5,B11), but that would have been too easy.

    Is there a way that I can do this using a formula?

    Thanks

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Lookup/Find Prefixes in Range

    Presumably something like

    =IF(MATCH(LEFT(B11,2),B3:B5,FALSE),"T","F")
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    07-13-2012
    Location
    USA
    MS-Off Ver
    Excel 365
    Posts
    7

    Re: Lookup/Find Prefixes in Range

    Thanks for the quick response. This will help in most cases but some of my prefixes will be longer than 2 characters. Do you think it is possible to handle this condition?

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Lookup/Find Prefixes in Range

    One way if there may be different lengths of alpha characters is

    =IF(ISERROR(MATCH(LEFT(B11,MIN(IF(ISERROR(FIND({1;2;3;4;5;6;7;8;9;0},B11)),"",FIND({1;2;3;4;5;6;7;8;9;0},B11)))-1),B3:B5,FALSE)),"F","T")

  5. #5
    Registered User
    Join Date
    07-13-2012
    Location
    USA
    MS-Off Ver
    Excel 365
    Posts
    7

    Re: Lookup/Find Prefixes in Range

    Thank for the info. I ended up using VB since the function started to become too unwieldy

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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