Conditional Formatting based on year

Solved/Closed
BrianGreen Posts 1005 Registration date Saturday January 17, 2015 Status Moderator Last seen September 30, 2021 - Feb 2, 2016 at 12:47 PM
BrianGreen Posts 1005 Registration date Saturday January 17, 2015 Status Moderator Last seen September 30, 2021 - Feb 2, 2016 at 01:23 PM
Guys,

I come again cap in hand with another plea for help on a sort of finished project, but I want to make it better.

I have some conditional formatting in a group of cells that colours a date cell green if a date is more than 30 days old, yellow if the date is 30 days old or less, or no colour if it has a dot in it. The format rules I have are here:

Cell value = "." ................... No Format Set ........... Stop If True
Cell Value <NOW()-30 .......... Green Background
Cell Value >=NOW()-30 ........ Yellow Background

My question is: how do I amend the rules to be based on the year instead of the day. The final product should turn a cell red if it is a year old. changing the 30 to 365 is no good as this wont take account of leap years.

Any help would be appreciated.

1 response

BrianGreen Posts 1005 Registration date Saturday January 17, 2015 Status Moderator Last seen September 30, 2021 150
Feb 2, 2016 at 01:23 PM
GOT IT = Wheeeeeee ....

instead of using the "NOW()" command I needed "EDATE()

Substituting "EDATE(TODAY(),-12)" where I had "NOW()-30" does the trick.

The final conditional formatting rules are:

Cell value = "." .......... ......... No Format Set ..... Stop If True
Cell Value <EDATE(TODAY(),-12) ...... Green Background
Cell Value >=EDATE(TODAY(),-12) .... Yellow Background

0