+ Reply to Thread
Results 1 to 5 of 5

Vlookup with two criteria and if met do a second vlookup

  1. #1
    Registered User
    Join Date
    07-23-2007
    Location
    Norfolk, England
    MS-Off Ver
    2007
    Posts
    27

    Vlookup with two criteria and if met do a second vlookup

    Hi

    I have a vlookup which has two criteria - if the returned value is greater than cell E3 (which is a date on the same sheet as the vlookup) or equal to zero, then vlookup the column preceding it. I have the following formula so far which just compares cell E3

    =IF(VLOOKUP(A3,Qualifications!$A$3:$S$104,5,0)>E3,VLOOKUP(A3,Qualifications!$A$3:$S$104,4,0),VLOOKUP(A3,Qualifications!$A$3:$S$104,5,0)))

    Kind regards,

    Mac

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,860
    Hello Mac,

    This is one way....

    =VLOOKUP(A3,qualifications!$A$3:$S$104,5-(OR(VLOOKUP(A3,qualifications!$A$3:$S$104,5,0)>E3,VLOOKUP(A3,qualifications!$A$3:$S$104,5,0)=0)),0)

  3. #3
    Registered User
    Join Date
    07-23-2007
    Location
    Norfolk, England
    MS-Off Ver
    2007
    Posts
    27
    daddylonglegs

    Thanks a million - You are a star. One final question on the matter.....if you wanted to return a value in a column (let's say 2 back and not just the 1), what would you write in the formula. You have it working perfectly for the preceding column, but what about the one before that one. eg. columns 3 and 5 and not 4 and 5 as your formula states?

    Regards,

    Mac

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,860
    Change to

    =VLOOKUP(A3,qualifications!$A$3:$S$104,5-2*(OR(VLOOKUP(A3,qualifications!$A$3:$S$104,5,0) >E3, VLOOKUP(A3,qualifications!$A$3:$S$104,5,0)=0)),0)

  5. #5
    Registered User
    Join Date
    07-23-2007
    Location
    Norfolk, England
    MS-Off Ver
    2007
    Posts
    27

    Smile

    Now that's just the ticket - I can sleep now.
    Many thanks to you.

    Mac

+ 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