+ Reply to Thread
Results 1 to 12 of 12

Lookup from a delimited field

  1. #1
    Forum Contributor
    Join Date
    08-24-2006
    Location
    Sevenoaks, Kent
    MS-Off Ver
    Office 365 ProPlus
    Posts
    459

    Lookup from a delimited field

    Good morning,

    Is it possible to perform a lookup on a delimited field?

    See the picture below. I want to perform a lookup in cell B1 which takes all the values from cell A1 and performs a lookup on the table E1:F4 & return the value in column F

    Example.JPG

    The desired output in cell B1 would be as follows;

    Result1, Result 2, Result 4

    Thanks in advance

    David

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

    Re: Lookup from a delimited field

    You can use this formula in B1:

    =SUBSTITUTE(IF(COUNTIF(A1,"*1*"),VLOOKUP(1,$E$1:$F$4,2,0)&", ","")&IF(COUNTIF(A1,"*2*"),VLOOKUP(2,$E$1:$F$4,2,0)&", ","")&IF(COUNTIF(A1,"*3*"),VLOOKUP(3,$E$1:$F$4,2,0)&", ","")&IF(COUNTIF(A1,"*4*"),VLOOKUP(4,$E$1:$F$4,2,0)&", ","")&"x",", x","")

    Hope this helps.

    Pete

  3. #3
    Forum Contributor
    Join Date
    08-24-2006
    Location
    Sevenoaks, Kent
    MS-Off Ver
    Office 365 ProPlus
    Posts
    459

    Re: Lookup from a delimited field

    Thanks Pete that's perfect.

  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
    80,898

    Re: Lookup from a delimited field

    Before you mark this as solved, could I ask that you check that your profile is up-to-date? Are you still using 2016 or something newer? Thanks.
    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.

  5. #5
    Forum Contributor
    Join Date
    08-24-2006
    Location
    Sevenoaks, Kent
    MS-Off Ver
    Office 365 ProPlus
    Posts
    459

    Re: Lookup from a delimited field

    Pete, what if column E - F has over 200 rows to look upon, is there an easier way of doing this rather than writing a massive formula?

  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,731

    Re: Lookup from a delimited field

    Glad to help, and thanks for the rep.

    Pete

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

    Re: Lookup from a delimited field

    Quote Originally Posted by djfatboyfats View Post
    Pete, what if column E - F has over 200 rows to look upon ...
    You just need to change the range of the table in the VLOOKUP terms, i.e. $E$1:$F$4 could become $E$1:$F$250

    If you mean that you might have more strings of numbers in cell A1 then I think it would need another approach.

    Pete

  8. #8
    Forum Contributor
    Join Date
    08-24-2006
    Location
    Sevenoaks, Kent
    MS-Off Ver
    Office 365 ProPlus
    Posts
    459

    Re: Lookup from a delimited field

    Hi Pete, I changed it to 250 but it's still not working. It is also picking up the 10 as a 1 (see below)

    Attachment 740438

  9. #9
    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
    44,054

    Re: Lookup from a delimited field

    Assuming you're on a PC, and not a Mac... use this:

    =TEXTJOIN(", ",,VLOOKUP(FILTERXML("<A><B>"&SUBSTITUTE(A1,",","</B><B>")&"</B></A>","//B"),E:F,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

  10. #10
    Forum Contributor
    Join Date
    08-24-2006
    Location
    Sevenoaks, Kent
    MS-Off Ver
    Office 365 ProPlus
    Posts
    459

    Re: Lookup from a delimited field

    Quote Originally Posted by Glenn Kennedy View Post
    Assuming you're on a PC, and not a Mac... use this:

    =TEXTJOIN(", ",,VLOOKUP(FILTERXML("<A><B>"&SUBSTITUTE(A1,",","</B><B>")&"</B></A>","//B"),E:F,2,FALSE))
    Hi Glenn, this is just what I needed. Thank you.

  11. #11
    Forum Contributor
    Join Date
    08-24-2006
    Location
    Sevenoaks, Kent
    MS-Off Ver
    Office 365 ProPlus
    Posts
    459

    Re: Lookup from a delimited field

    Hi Ali, this is done.

  12. #12
    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
    44,054

    Re: Lookup from a delimited field

    You're welcome & thanks for the feedback!

+ 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. Create a Condition Coma Delimited and Space Delimited
    By ajg4290 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-08-2019, 05:26 PM
  2. Excel Field Data pipe delimited with many fields inside
    By ginjack in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-14-2015, 04:35 PM
  3. Parse Delimited Text Field Connected to ODBC Database
    By jennarenae in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 11-03-2014, 06:17 PM
  4. [SOLVED] Pipe delimited vs comma delimited problem
    By theletterh in forum Excel General
    Replies: 4
    Last Post: 01-23-2013, 07:27 PM
  5. Replies: 9
    Last Post: 05-22-2012, 08:59 AM
  6. Parsing a delimited field
    By rookiejoe72 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-18-2011, 05:05 PM
  7. [SOLVED] Export file to CSV delimited with fixed field length
    By Plucky Duck in forum Excel General
    Replies: 2
    Last Post: 05-28-2005, 06:05 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