#1   Report Post  
Debbie F
 
Posts: n/a
Default Comparing dates

Hi

I have a date in A5 and I need to write a formula in an adjacent column that
checks the date and if the date is less than 3 months old to display it in
another colour, if it is more than 3 months old to do nothing.

I am not sure which date function to use. Can anyone help?

Thanks
  #2   Report Post  
MS Office
 
Posts: n/a
Default

=MONTH(TODAY())-MONTH(A5)

The above formula will calculate the difference ( in number of months)
between today's date and the date in A5.
You may then apply conditional formatting.



"Debbie F" <Debbie wrote in message
...
Hi

I have a date in A5 and I need to write a formula in an adjacent column
that
checks the date and if the date is less than 3 months old to display it in
another colour, if it is more than 3 months old to do nothing.

I am not sure which date function to use. Can anyone help?

Thanks



  #3   Report Post  
Biff
 
Posts: n/a
Default

Hi!

Select cell A5

Goto FormatConditional Formatting
Select Formula IS
Enter this formula:

=AND(ISNUMBER(A5),A5DATE(YEAR(TODAY()),MONTH(TODA Y())-3,DAY(TODAY())))

Click the Format button and select the style(s) you want
OK out

Biff

"Debbie F" <Debbie wrote in message
...
Hi

I have a date in A5 and I need to write a formula in an adjacent column
that
checks the date and if the date is less than 3 months old to display it in
another colour, if it is more than 3 months old to do nothing.

I am not sure which date function to use. Can anyone help?

Thanks



  #4   Report Post  
David McRitchie
 
Posts: n/a
Default

no it will not, and left out how 3 months is to be worked in anyway.

would suggest looking at Chip Pearson's page
http://www.cpearson.com/excel/datedif.htm


"MS Office" wrote in message ...
=MONTH(TODAY())-MONTH(A5)

The above formula will calculate the difference ( in number of months)
between today's date and the date in A5.
You may then apply conditional formatting.



"Debbie F" <Debbie wrote in message
...
Hi

I have a date in A5 and I need to write a formula in an adjacent column
that
checks the date and if the date is less than 3 months old to display it in
another colour, if it is more than 3 months old to do nothing.

I am not sure which date function to use. Can anyone help?

Thanks





  #5   Report Post  
Debbie F
 
Posts: n/a
Default

Thanks very much

"MS Office" wrote:

=MONTH(TODAY())-MONTH(A5)

The above formula will calculate the difference ( in number of months)
between today's date and the date in A5.
You may then apply conditional formatting.



"Debbie F" <Debbie wrote in message
...
Hi

I have a date in A5 and I need to write a formula in an adjacent column
that
checks the date and if the date is less than 3 months old to display it in
another colour, if it is more than 3 months old to do nothing.

I am not sure which date function to use. Can anyone help?

Thanks






  #6   Report Post  
Biff
 
Posts: n/a
Default

Hi!

Today = Sept 7 2005
A5 = Sept 30 2004

Your formula would return 0 and since zero is less than 3 the wrong format
would be applied.

Another thing to consider is how do you measure a month? 29 days? 30 days?
31 days?

Biff

"MS Office" wrote in message
...
=MONTH(TODAY())-MONTH(A5)

The above formula will calculate the difference ( in number of months)
between today's date and the date in A5.
You may then apply conditional formatting.



"Debbie F" <Debbie wrote in message
...
Hi

I have a date in A5 and I need to write a formula in an adjacent column
that
checks the date and if the date is less than 3 months old to display it
in
another colour, if it is more than 3 months old to do nothing.

I am not sure which date function to use. Can anyone help?

Thanks





  #7   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Wed, 7 Sep 2005 14:12:26 +1000, "MS Office"
wrote:

=MONTH(TODAY())-MONTH(A5)

The above formula will calculate the difference ( in number of months)
between today's date and the date in A5.
You may then apply conditional formatting.


It will only do this if you require that both months be in the same year.

Try testing it by substituting 5 Jan 2006 for today and A5: 1 Sep 2005


--ron
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
2 digit year in dates return 19xx not 20xx moranbo Excel Discussion (Misc queries) 1 September 7th 05 01:44 AM
return array result in cell based on comparing dates Ruthki Excel Worksheet Functions 7 June 30th 05 11:41 PM
Comparing Dates using Greater Than and Less than waipio2 Excel Discussion (Misc queries) 1 June 7th 05 09:48 PM
Comparing dates in an IF function Paula Excel Worksheet Functions 3 January 12th 05 02:21 PM
Formating Dates for production schedule dpl7579 Excel Discussion (Misc queries) 1 January 11th 05 08:43 PM


All times are GMT +1. The time now is 04:12 PM.

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

About Us

"It's about Microsoft Excel"