+ Reply to Thread
Results 1 to 4 of 4

look-up a date in a range and find the date that is closest todays date

  1. #1
    Registered User
    Join Date
    03-12-2014
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    2

    look-up a date in a range and find the date that is closest todays date

    I would like to look-up a date in a range and find the date that is closest today's date and return that value to a cell (C2):

    B2: Todays Date: 1/30/14
    C2: Next Upcoming date ?

    A1: 2/1/14
    A2: 2/2/14
    A3: 3/1/14

    As an added challenge, if there is date in the range that is older than today’s date (past due), I would like it to return that value:

    B2: Todays Date: 1/30/14
    C2: Next Upcoming date ?

    A1: 2/1/14
    A2: 2/2/14
    A3: 3/1/14
    A4: 1/1/14

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

    Re: look-up a date in a range and find the date that is closest todays date

    If I understand, maybe this array formula**:

    =IF(COUNTIF(A1:A4,"<="&TODAY()),MIN(IF(A1:A4<=TODAY(),A1:A4)),MIN(IF(A1:A4>=TODAY(),A1:A4)))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    03-12-2014
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: look-up a date in a range and find the date that is closest todays date

    Very Helpful... Thank You!!

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

    Re: look-up a date in a range and find the date that is closest todays date

    You're welcome. Thanks for the feedback!

+ 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. [SOLVED] Function/formula to compare and insert todays date or yesterdays date
    By TC922 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-17-2013, 05:28 AM
  2. Replies: 1
    Last Post: 04-04-2012, 08:21 AM
  3. Replies: 2
    Last Post: 01-04-2012, 09:15 AM
  4. find closest date (number) in a range
    By wamp in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-23-2010, 01:50 PM
  5. Using VB to find a range based on todays date and todays date +30
    By Steve_al in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-13-2009, 09:31 AM

Tags for this Thread

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