+ Reply to Thread
Results 1 to 4 of 4

vlookup in second column if first result no good

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

    vlookup in second column if first result no good

    Hi

    I have stumbled upon a brick wall and can't progress any further. Basically, I have a sheet with two date columns. The first date column is entered manually and the second date column performs a vlookup from a separate sheet with two sets of dates. I want the result of the vlookup to be compared to the date in the static column one. If the date is earlier than column one I want to perform a second vlookup from the table and return the date in the next column. In a nutshell, the table of data that the vlookup is looking for, has an early date and a late date and depending on what static date is displayed on column one, sheet one, depicts whether an early or late date is returned into column two. I am probably making this out to sound way more complicated that it really is to somebody with Excel experience. I hope somebody can help me out on this one, as it's driving me nuts.

    Many thanks,

    Mac

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Try something like this

    =IF(VLOOKUP(Value1,Range,Col_Num1,FALSE)<=Value1,VLOOKUP(Value2,Range,Col_Num2,FALSE),"")

    Value1 being a date that is less or equal to than the manual entered date
    Value2 being a date that is more than manual entered date
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,677
    OK,

    assume your static date is in A2 and you want to look this up initially in sheet2!A2:A10 and return a date from the next column - but if that date is less than A2 you want to return a date from column C. Try something like

    =IF(VLOOKUP(A2,sheet2!A2:C10,2,0)<A2, VLOOKUP(A2,sheet2!A2:C10,3,0), VLOOKUP(A2,sheet2!A2:C10,2,0))

  4. #4
    Registered User
    Join Date
    07-23-2007
    Location
    Norfolk, England
    MS-Off Ver
    2007
    Posts
    27
    Thank you very much to you both. It's amazing when the answer is in front of you that it all looks so simple.

    Much obliged,

    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