+ Reply to Thread
Results 1 to 5 of 5

Detect oldest date in a range

  1. #1
    Registered User
    Join Date
    09-04-2014
    Location
    North Carolina
    MS-Off Ver
    2007
    Posts
    4

    Detect oldest date in a range

    I know that there's probably a simple answer for my question, but I can't seem to get my mind wrapped around finding a answer!
    I have a worksheet that in column (A) there are several employee names, in column (B) are their corresponding employee numbers, and in column (C) are their corresponding hire dates, and finally in the next five columns are cells to enter dates. Looks something like this:

    A | B | C | D | E | F | G | H |
    6 Tom | 4862 | 05/14/10 | 05/10/15 | 06/10/15 |
    7 Fred | 5287 | 07/30/11 | 05/23/15 | 06/24/15 |
    8 Mac | 6812 | 02/21/12 | 05/27/15 | |
    9 Jack | 6958 | 03/11/12 | 05/12/15 | |

    This worksheet is used for tracking days that each employee preformed a certain task, so it’s a rotation schedule based on who hasn’t done the task in the longest time,
    so in this case it would be Jack, because he last done it on 05/12/15.

    What I’m wanting to do is automate the selection process based on the dates within range of D6:D34
    I know that =MIN(D6:J34) will get me the oldest date within the range, but then it needs to look to the right of that cell and see if there is a date in it
    and if so move on to the next oldest date and perform the process all over again because =MIN(D6:J34) will yield 05/10/15 (Tom) when I need it to tell me
    that actually it’s Jack that should be up next !

    Please Help, because I’ve been racking my brain trying to do this and have
    used up no telling how much bandwidth googling this headache

    Thanks
    Heterodoxy

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,127

    Re: Detect oldest date in a range

    Here's one way (uses a helper colum to find the latest entry per row):

    =LOOKUP(1E+100,C2:H2)

    followed by an index match to see who's next:

    =INDEX($A$2:$A$5,MATCH(MIN($I$2:$I$5),$I$2:$I$5,0))

    see sheet attached for cell positions, etc.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    08-23-2015
    Location
    Spain
    MS-Off Ver
    2007
    Posts
    32

    Re: Detect oldest date in a range

    Send the book and I will do it in a minute without VBA code... but you'll find the solution to be awesome, I promise!
    May the REPUTATION be with me

  4. #4
    Registered User
    Join Date
    09-04-2014
    Location
    North Carolina
    MS-Off Ver
    2007
    Posts
    4

    Re: Detect oldest date in a range

    It work great!
    Thanks for your help

    The only change that I had to make was with the [ =LOOKUP(1E+100,C2:H2) ] formula - kept getting a #N/A error
    realized that it happen when there wasn't any value in a row that it was looking at - dummy me, but corrected the issue with:
    =IF(ISNA(LOOKUP(1E+100,C2:H2)),"",LOOKUP(1E+100,C2:H2))

    Thanks Again
    Heterodoxy

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Detect oldest date in a range

    Quote Originally Posted by Heterodoxy View Post
    =IF(ISNA(LOOKUP(1E+100,C2:H2)),"",LOOKUP(1E+100,C2:H2))
    If you're using Excel 2007 or later you can reduce that to:

    =IFERROR(LOOKUP(1E100,C2:H2),"")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 09-15-2014, 12:56 PM
  2. [SOLVED] lesson grades (from oldest date to newest date)
    By aaaaa34 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-04-2014, 08:40 AM
  3. [SOLVED] Find Oldest Date in Column but only if their is no date to the right
    By Bikeman in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-02-2014, 12:59 PM
  4. Find the oldest date
    By Rachel555 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-03-2013, 06:50 AM
  5. sorting a selected range by date, oldest to newest
    By zed commander in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-19-2012, 12:40 PM
  6. [SOLVED] Formula that displays the oldest date and earliest date
    By mrcois in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-20-2012, 12:22 AM
  7. oldest date
    By kghisla in forum Excel General
    Replies: 2
    Last Post: 02-21-2011, 12:09 AM

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