+ Reply to Thread
Results 1 to 9 of 9

if Contains Vlookup Formula

  1. #1
    Registered User
    Join Date
    03-15-2011
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    4

    Red face if Contains Vlookup Formula

    Hi,

    I am not sure if this will be possible or not, but...

    I am trying to do a Vlookup against a description (as the lookup value), but instead of returning the corresponding value for an exact match...I want it to return the corresponding column if part of the lookup key is contained within the description (lookup value).

    I have attached a spreadsheet that may help give clearer context to my question.

    Any help would be extremely appreciated.


    Sam.
    Attached Files Attached Files

  2. #2
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: if Contains Vlookup Formula

    i think this will accomplish what you are looking for

    =VLOOKUP(LEFT(A2,5),D:E,2,0)
    If you liked my solution, please click on the Star -- to add to my reputation

    If your issue as been resolved, please clearly state so and mark the thread as [SOLVED] using the thread tools just above the first post.

  3. #3
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: if Contains Vlookup Formula

    Hello Sam, try this in B2

    =IFERROR(LOOKUP(9E300,SEARCH(D$2:D$10,A2),E$2:E$10),"")

    Then copy down
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  4. #4
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: if Contains Vlookup Formula

    To me it seems possible if I use wild card. Because you have two agric in short key, the lookup is going to extract the first value it found.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-15-2011
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: if Contains Vlookup Formula

    This works, thankyou so much for your help and extremely quick response.

    Quote Originally Posted by DGagnon View Post
    i think this will accomplish what you are looking for

    =VLOOKUP(LEFT(A2,5),D:E,2,0)

  6. #6
    Registered User
    Join Date
    03-15-2011
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: if Contains Vlookup Formula

    This also works, thankyou so much for your help and extremely quick response.

    Quote Originally Posted by Haseeb A View Post
    Hello Sam, try this in B2

    =IFERROR(LOOKUP(9E300,SEARCH(D$2:D$10,A2),E$2:E$10),"")

    Then copy down

  7. #7
    Registered User
    Join Date
    03-15-2011
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: if Contains Vlookup Formula

    This ALSO works! Thanks for your help.

    Yeah, the repeated values in the reference list poses a problem.

    This has happened because the reference list was originaly created using a left trim formula on a free text description.

    Thanks again.

    Quote Originally Posted by JieJenn View Post
    To me it seems possible if I use wild card. Because you have two agric in short key, the lookup is going to extract the first value it found.

  8. #8
    Registered User
    Join Date
    02-21-2013
    Location
    Athens, Greece
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: if Contains Vlookup Formula

    hey there

    i have a similar query, somewhat easier i think.

    i'm trying to combine VLOOKUP and IF fuctions for cells that contain certain 4-digit numbers. The idea is that if the cells in column E contain any of the values in column A then it returns the classification value in cell D

    any help would be great!
    Attached Files Attached Files

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: if Contains Vlookup Formula

    Ferrari7,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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