+ Reply to Thread
Results 1 to 6 of 6

Finding Nearest date in a range based on critera date

  1. #1
    Forum Contributor
    Join Date
    11-08-2011
    Location
    Leeds
    MS-Off Ver
    Excel 2010
    Posts
    279

    Finding Nearest date in a range based on critera date

    Hi All,


    I just have a little problem, ive attached an example, what I'm trying to do is take the date in A1 and find the nearest date to that date which was before A1 happneded and for it to return the T number.

    I hope I have explained this properly and the attached clears up anything Ive missed.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Finding Nearest date in a range based on critera date

    Try this formula in A3

    Format as Date

    =LOOKUP(A2,B2:H2,B2:H2)
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: Finding Nearest date in a range based on critera date

    Is it possible to arrange the date/times in row 2 to be in chronological order?

    Pete

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Finding Nearest date in a range based on critera date

    Try in H2:

    =LOOKUP(2,1/(MIN(ABS(A2-B2:G2))=ABS(A2-B2:G2)),B$1:G$1)

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    Quang PT

  5. #5
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Finding Nearest date in a range based on critera date

    Sorry, should've read the requirements more carefully.

    =INDEX(B1:G1,MAX(INDEX((B2:G2<A2)*(COLUMN(B2:G2)-1),0)))

  6. #6
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: Finding Nearest date in a range based on critera date

    Or this one
    =INDEX(B1:G1,,MATCH(A2,B2:G2,1))
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

+ 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] Find the Exact date, Nearest old and new date for the given input Letter) and date
    By thilag in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-17-2015, 05:13 AM
  2. Matching with a nearest date in a date range?
    By mrxlsx in forum Excel General
    Replies: 2
    Last Post: 05-05-2015, 01:23 PM
  3. Highlight Rows Based on Date Range Using Static Date and Current Date
    By SaraStravers in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-23-2015, 07:38 PM
  4. Finding the nearest date in a column with reference to today
    By lenare in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-24-2013, 10:51 AM
  5. Finding a date in a text string and comparing it to a date range
    By ABARAN1000 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-05-2012, 02:55 PM
  6. Count mulitiple critera in a date range.
    By Abuckle in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-30-2012, 04:01 PM
  7. Search named range for multiple matches to critera and return date & values
    By a.mack123 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-18-2011, 10:07 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