+ Reply to Thread
Results 1 to 8 of 8

Vlookup based on 2 vlookup values

  1. #1
    Forum Contributor
    Join Date
    02-21-2007
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    389

    Vlookup based on 2 vlookup values

    Here is the formula I use:

    =IF(ISERROR(VLOOKUP(H5;SHEET2!B:AB;3;FALSE));"";VLOOKUP(H5;SHEET2!B:AB;3;FALSE))

    I would need to use that same formula based on 2 lookup value:

    IF cell F5 is empty "" Then use that formula:

    =IF(ISERROR(VLOOKUP(H5;SHEET2!B:AB;3;FALSE));"";VLOOKUP(H5;SHEET2!B:AB;3;FALSE))

    BUT IF cell F5 is NOT empty or IF H5 is empty then use that formula:

    =IF(ISERROR(VLOOKUP(F5;SHEET2!B:AB;3;FALSE));"";VLOOKUP(F5;SHEET2!B:AB;3;FALSE))

    How could I combine these two formula?

    Many thanks in advance,
    Graig

  2. #2
    Registered User
    Join Date
    07-16-2012
    Location
    Newcastle upon Tyne
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: Vlookup based on 2 vlookup values

    =if(iserror(vlookup(if(f5="";h5;f5);sheet2!b:ab;3;false));"";vlookup(if(f5="";h5;f5);sheet2!b:ab;3;false))

  3. #3
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Vlookup based on 2 vlookup values

    Use ...replace the , with ;

    =IFERROR(VLOOKUP(H5,Sheet2!B:AB,3,FALSE),(IFERROR(VLOOKUP(F5,Sheet2!B:AB,3,FALSE),"")))
    Life's a spreadsheet, Excel!
    Say thanks, Click *

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

    Re: Vlookup based on 2 vlookup values

    Try this one (untested)

    Please Login or Register  to view this content.
    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.

  5. #5
    Forum Contributor
    Join Date
    02-21-2007
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    389

    Re: Vlookup based on 2 vlookup values

    Hello the two first reply work but I only get a result when I fill the cell F5.

    If I empty the cell F5 and fill the Cell H5 I do not get the result I should get...If I have my formula in one cell and one of the two first you gave me I get the correct result but in two different cell the idea was to gather the formulas and be able to use two lookup value (not at the same time..)

    Thanks,
    Graig

  6. #6
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Vlookup based on 2 vlookup values

    any instances that both cell (F5 and H5 )has value?
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  7. #7
    Registered User
    Join Date
    07-16-2012
    Location
    Newcastle upon Tyne
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: Vlookup based on 2 vlookup values

    Hi Graig,

    How are you "emptying" F5? I've known some people to press Space, instead of Delete, so that they see an "empty" cell. However, that cell would contain " ", not "". Which would explain why those formulae don't work as expected. If that isn't the case, perhaps we need a little more explanation of your data and expected results.

  8. #8
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Vlookup based on 2 vlookup values

    if the case is as post#6 maybe you could do it like this..

    for text in H or F

    Please Login or Register  to view this content.
    for numbers in F or H
    Please Login or Register  to view this content.
    i jusy notice that you're returning the same column -
    Sheet2!B:AB,3

+ 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