+ Reply to Thread
Results 1 to 6 of 6

Partial Vlookup if a text is found

  1. #1
    Registered User
    Join Date
    07-07-2020
    Location
    Poland
    MS-Off Ver
    O365
    Posts
    2

    Partial Vlookup if a text is found

    Hi Everyone,
    I've a problem with figuring out how to use Vlookup to find only a part of a text.
    So as an example, in the first column I have a list of fruits which are randomly inserted between some characters.
    I'd need a formula which would look for a fruit in the first column and if a fruit is found then return its colour.
    Vlookup with approximate match doesn't help here.


    1111*Apple*1111 Apple Green
    -Apple- Apple Green
    ---Pineapple--- Pienapple Yellow
    *Pineapple* Pineapple Yellow

    Thanks a lot for your help!
    Attached Files Attached Files
    Last edited by bart90; 07-07-2020 at 10:51 AM.

  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. 2407 (Windows 11 23H2 64-bit)
    Posts
    82,886

    Re: Partial Vlookup if a text is found

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your 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 Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Partial Vlookup if a text is found

    I used 2 helpcolumns to get the result.

    C3 (green cells) are the result.

    D3 =IFERROR(SEARCH($D$2,$A3,1),0) and drag down

    E3 =IFERROR(SEARCH($E$2,$A3,1),0) and drag down

    C3 =IF(AND(D3=0,E3=0),"error",IF(D3>0,$D$1,$E$1)) and drag down

    See the attached file.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Registered User
    Join Date
    07-07-2020
    Location
    Poland
    MS-Off Ver
    O365
    Posts
    2

    Re: Partial Vlookup if a text is found

    HI Oeldere,
    Thanks for your suggestion, it would indeed work if I had only two 'fruits' and 'colors' in my report.
    In your formula the number of choices is restricted to 2 - IF(D3>0,$D$1,$E$1).
    The problem is that I have around 16K lines in which 'fruits' appear and the 'fruits' amount to around 230 (along with 230 'colors')
    Using nested formula for if might be an option but perhaps there's an easier way?
    Thanks

  5. #5
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Partial Vlookup if a text is found

    Please try at C3

    =LOOKUP(0;-FIND($D$3:$D$4;A3);$E$3:$E$4)
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Partial Vlookup if a text is found

    The problem is that I have around 16K lines in which 'fruits' appear and the 'fruits' amount to around 230 (along with 230 'colors')
    You did not add that is your question.


    How come the data is so messy, maybe that could be a part of the solution.

+ 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. VLOOKUP only if partial text is found
    By grant langley in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-05-2019, 12:38 PM
  2. VLOOKUP; Partial Text...
    By needhelp889 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-11-2018, 02:57 PM
  3. [SOLVED] Look for Partial Text and Return Values IF found or Not
    By mrsbrannon in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-06-2018, 11:40 AM
  4. [SOLVED] Vlookup with partial text VBA help
    By itty in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-12-2015, 10:25 AM
  5. VLOOKUP Partial matches when searched text is longer than actual text
    By mockions in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-23-2015, 11:16 PM
  6. [SOLVED] Find partial text in cell and assign variable a value if found
    By lday75 in forum Excel General
    Replies: 4
    Last Post: 07-26-2012, 01:36 PM
  7. Partial text vlookup
    By vijanand1279 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-06-2011, 05:35 AM

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