Change all the $G2 to G15 as your first row of selected range is 15.
Conditional Formatting for Dates
Hello
I have a column showing a list of expiry dates, formatted as mmm-yy. I would like it to automatically format so that:
- Any dates that are in the past are filled with red
- Any dates that fall within three months from today are filled with orange
- Any dates that fall within four and twelve months from today are filled with yellow
- Any dates further into the future than twelve months remain unformatted.
I've tried to fathom out how to do this, but am failing miserably, so all advice gratefully received. Thank you.
Microsoft 365 and Office | Excel | For business | Windows
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
-
Anonymous
2025-02-05T14:31:33+00:00
5 additional answers
Sort by: Most helpful
-
HansV 462.3K Reputation points MVP Volunteer Moderator2025-02-05T12:16:30+00:00 Select the dates.
On the Home tab of the ribbon, click Conditional Formatting > New Rule...
Select 'Format only cells that contain'.
Leave the first drop down set to 'Cell Value'.
Select 'less than' from the second drop down.
In the box next to it, enter the formula=EDATE(TODAY(), 12)
Click Format...
Activate the Fill tab.
Select yellow as fill color.
Click OK, then click OK again.Repeat these steps, but with
=EDATE(TODAY(), 4)
and orange as fill color.
Finally, repeat them again with
=TODAY()
and red as fill color.
-
Anonymous
2025-02-05T13:15:08+00:00 That's worked brilliantly, thank you!
What would I need to do to get the whole row to highlight in those colours, rather than just the cell with the date in it?
When I say the whole row, there is only data in Columns A to G, so it would only really need to be through those.
Thank you again!
Select the dates.
On the Home tab of the ribbon, click Conditional Formatting > New Rule...
Select 'Format only cells that contain'.
Leave the first drop down set to 'Cell Value'.
Select 'less than' from the second drop down.
In the box next to it, enter the formula=EDATE(TODAY(), 12)
Click Format...
Activate the Fill tab.
Select yellow as fill color.
Click OK, then click OK again.Repeat these steps, but with
=EDATE(TODAY(), 4)
and orange as fill color.
Finally, repeat them again with
=TODAY()
and red as fill color.