A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Formula to find the date closest to today.



 
 
Thread Tools Display Modes
  #1  
Old January 14th, 2008, 04:41 PM posted to microsoft.public.excel.misc
jem264
external usenet poster
 
Posts: 1
Default Formula to find the date closest to today.

I have a list of dates in row 1, from B1:BK1. Most of them are Sundays, but a
few are in the middle of the week. I need a formula that I can enter into
another sheet to find the date from this list that is closest to today(). I
found an array formula that will work, I hope to be able to do this without
the array, I do not want to add any more data to the sheets, if possible.
Thanks in advance
  #2  
Old January 14th, 2008, 06:33 PM posted to microsoft.public.excel.misc
T. Valko
external usenet poster
 
Posts: 15,759
Default Formula to find the date closest to today.

find the date from this list that is closest to today().

I assume that closest means either before or after (if not an exact match).

Normally entered:

=INDEX(B1:BK1,MATCH(TRUE,INDEX(ABS(B1:BK1-TODAY())=MIN(INDEX(ABS(B1:BK1-TODAY()),1,)),1,),0))

Format as DATE

--
Biff
Microsoft Excel MVP


"jem264" wrote in message
...
I have a list of dates in row 1, from B1:BK1. Most of them are Sundays, but
a
few are in the middle of the week. I need a formula that I can enter into
another sheet to find the date from this list that is closest to today().
I
found an array formula that will work, I hope to be able to do this
without
the array, I do not want to add any more data to the sheets, if possible.
Thanks in advance



  #3  
Old February 26th, 2010, 06:19 PM posted to microsoft.public.excel.misc
Linda Racine
external usenet poster
 
Posts: 1
Default I assume that closest means either before or after (if not an exactmatch).

How does the formula need to change if one only wants to return a date after today?



T. Valko wrote:

I assume that closest means either before or after (if not an exact match).
14-Jan-08

I assume that closest means either before or after (if not an exact match).

Normally entered:

=INDEX(B1:BK1,MATCH(TRUE,INDEX(ABS(B1:BK1-TODAY())=MIN(INDEX(ABS(B1:BK1-TODAY()),1,)),1,),0))

Format as DATE

--
Biff
Microsoft Excel MVP


"jem264" wrote in message
...

Previous Posts In This Thread:

On Monday, January 14, 2008 11:41 AM
jem26 wrote:

Formula to find the date closest to today.
I have a list of dates in row 1, from B1:BK1. Most of them are Sundays, but a
few are in the middle of the week. I need a formula that I can enter into
another sheet to find the date from this list that is closest to today(). I
found an array formula that will work, I hope to be able to do this without
the array, I do not want to add any more data to the sheets, if possible.
Thanks in advance

On Monday, January 14, 2008 1:33 PM
T. Valko wrote:

I assume that closest means either before or after (if not an exact match).
I assume that closest means either before or after (if not an exact match).

Normally entered:

=INDEX(B1:BK1,MATCH(TRUE,INDEX(ABS(B1:BK1-TODAY())=MIN(INDEX(ABS(B1:BK1-TODAY()),1,)),1,),0))

Format as DATE

--
Biff
Microsoft Excel MVP


"jem264" wrote in message
...


Submitted via EggHeadCafe - Software Developer Portal of Choice
WPF Custom Validation Using the Enterprise Library
http://www.eggheadcafe.com/tutorials...ation-usi.aspx
  #4  
Old February 26th, 2010, 06:27 PM posted to microsoft.public.excel.misc
T. Valko
external usenet poster
 
Posts: 15,759
Default I assume that closest means either before or after (if not an exact match).

If you want the minimum date that is greater than today...

Array entered** :

=MIN(IF(A1:A10TODAY(),A1:A10))

** 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.

Format as Date

--
Biff
Microsoft Excel MVP


Linda Racine wrote in message
...
How does the formula need to change if one only wants to return a date
after today?



T. Valko wrote:

I assume that closest means either before or after (if not an exact
match).
14-Jan-08

I assume that closest means either before or after (if not an exact
match).

Normally entered:

=INDEX(B1:BK1,MATCH(TRUE,INDEX(ABS(B1:BK1-TODAY())=MIN(INDEX(ABS(B1:BK1-TODAY()),1,)),1,),0))

Format as DATE

--
Biff
Microsoft Excel MVP


"jem264" wrote in message
...

Previous Posts In This Thread:

On Monday, January 14, 2008 11:41 AM
jem26 wrote:

Formula to find the date closest to today.
I have a list of dates in row 1, from B1:BK1. Most of them are Sundays,
but a
few are in the middle of the week. I need a formula that I can enter into
another sheet to find the date from this list that is closest to today().
I
found an array formula that will work, I hope to be able to do this
without
the array, I do not want to add any more data to the sheets, if possible.
Thanks in advance

On Monday, January 14, 2008 1:33 PM
T. Valko wrote:

I assume that closest means either before or after (if not an exact
match).
I assume that closest means either before or after (if not an exact
match).

Normally entered:

=INDEX(B1:BK1,MATCH(TRUE,INDEX(ABS(B1:BK1-TODAY())=MIN(INDEX(ABS(B1:BK1-TODAY()),1,)),1,),0))

Format as DATE

--
Biff
Microsoft Excel MVP


"jem264" wrote in message
...


Submitted via EggHeadCafe - Software Developer Portal of Choice
WPF Custom Validation Using the Enterprise Library
http://www.eggheadcafe.com/tutorials...ation-usi.aspx



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:22 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.