Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
=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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
#8
|
|||
|
|||
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
2 digit year in dates return 19xx not 20xx | Excel Discussion (Misc queries) | |||
return array result in cell based on comparing dates | Excel Worksheet Functions | |||
Comparing Dates using Greater Than and Less than | Excel Discussion (Misc queries) | |||
Comparing dates in an IF function | Excel Worksheet Functions | |||
Formating Dates for production schedule | Excel Discussion (Misc queries) |