+ Reply to Thread
Results 1 to 7 of 7

Vlookup within date range

Hybrid View

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

    Vlookup within date range

    I need to do a Vlookup, but there are many entries with the same employee number.

    Example - Bob who's employee number is 12345678 is planned to go away Jan-Mar 08, Jun-Aug and then again Dec-Feb 09. When I do a Vlookup for him I get a return of the first date, but I need to stipulate which date is displayed in the report. Basically, I require the date he is away after todays date and not later than 3 months from now, which would return the Jun-Aug date.

    Hope you can help.

    Regards,

    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
    Hi,

    I'm sure you could adopt this one for your purposes, all you need to do is list your employees in the main sheet with the months they are away, then go to the next sheet and in B1 enter the employee number you should then get all the dates

    http://www.excelforum.com/showthread.php?t=603695
    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
    Registered User
    Join Date
    07-23-2007
    Location
    Norfolk, England
    MS-Off Ver
    2007
    Posts
    27
    What I'm after is a Vlookup formula which returns the date from today until 3 months and then ignore all the other dates that the individual is away

  4. #4
    Forum Contributor
    Join Date
    10-30-2007
    Location
    Norway
    MS-Off Ver
    MS Office 2007
    Posts
    345
    This example shows you how you can filter your list to only get a match on a date within the next 90 days. What I have done is to insert a new employee number column that only displays the employee number if the matching date is within the requested range. Then I have used this new column as the lookup range for the vlookup formula.

    The vlookup still displays the first match if there are more matches within the next 90 days. You can easily get the correct result by just sorting your list by the date column. If sorting the list is not an option, you need another approach. Let me know, and I will try to figure something out.
    Attached Files Attached Files

  5. #5
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Nice example Bjornar

  6. #6
    Registered User
    Join Date
    07-23-2007
    Location
    Norfolk, England
    MS-Off Ver
    2007
    Posts
    27
    Many thanks Bjornar. Your example is exactly what I was looking for.

    Kind regards,

    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