Conditional formatting of dates

BIGPHILL

New Member
Joined
Dec 14, 2017
Messages
11
I have a date column in my spreadsheet. I want the date in the cell to go Red if the date has come and gone, amber if the current month and green if the date is ahead.

I know there is conditional formatting, however it only allows me to choose next month to go green, and last month to go red, not all the other months for example 2 months in advance.


Anyone have any suggestions for me on how to do this.

Thanks
 
=and ( g5<today()-31
< </today()-31
TODAY()-31<today()-31
, g5 < > "" )</today()-31
 
Upvote 0

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hello All,Last little bit of help needed by me,
Can someone tell me the formula for what i need below.

When i enter a date and for the duration within 9 months i would like cell to it go green
When i enter a date and for the duration when its 9 12 months old then to go amber
When i enter a date and duration of 1 year passes then to go Red.Thank you all for your help.
 
Last edited:
Upvote 0
three rules
1 for red, 1 for green and 1 for amber

use date()

assuming the date is entered into G5 again

Put in this ORDER - you use an arrow button on the conditional formatting to change the order
and USE STOP if true

RED rule
=AND(G5 < > "",G5 < DATE(YEAR(TODAY())-1,MONTH(TODAY()),DAY(TODAY())))

Amber
=AND(G5 < > "",G5 < DATE(YEAR(TODAY()),MONTH(TODAY())-9,DAY(TODAY())))

Green = less than today
=AND(G5 < > "",G5 < DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY())))

If the date is in the future no colour applied
 
Upvote 0
Excel Workbook
G
511/01/2017
611/07/2017
711/02/2017
811/02/2018
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
G51. / Formula is =AND(G5<>"",G5Abc
G52. / Formula is =AND(G5<>"",G5Abc
G53. / Formula is =AND(G5<>"",G5Abc
G61. / Formula is =AND(G5<>"",G5Abc
G62. / Formula is =AND(G5<>"",G5Abc
G63. / Formula is =AND(G5<>"",G5Abc
G71. / Formula is =AND(G5<>"",G5Abc
G72. / Formula is =AND(G5<>"",G5Abc
G73. / Formula is =AND(G5<>"",G5Abc
G81. / Formula is =AND(G5<>"",G5Abc
G82. / Formula is =AND(G5<>"",G5Abc
G83. / Formula is =AND(G5<>"",G5Abc
 
Upvote 0
Thank you for your reply, I tried the above Formula in G5 and i have error message come up ...Forumla you have typed contains an error. Is this because i just copied it across?

Many thanks for your help.


  • RED rule
    =AND(G5 < > "",G5 < DATE(YEAR(TODAY())-1,MONTH(TODAY()),DAY(TODAY())))

    Amber
    =AND(G5 < > "",G5 < DATE(YEAR(TODAY()),MONTH(TODAY())-9,DAY(TODAY())))

    Green = less than today
    =AND(G5 < > "",G5 < DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY())))




 
Last edited:
Upvote 0
probably
BUT I have to add spaces to stop the forum from using the code as HTML
Code:
[COLOR=#333333]RED rule[/COLOR]
[COLOR=#333333]=AND(G5<>"",G5<DATE(YEAR(TODAY())-1,MONTH(TODAY()),DAY(TODAY())))[/COLOR]

[COLOR=#333333]Amber[/COLOR]
[COLOR=#333333]=AND(G5<>"",G5<DATE(YEAR(TODAY()),MONTH(TODAY())-9,DAY(TODAY())))[/COLOR]

[COLOR=#333333]Green = less than today[/COLOR]
[COLOR=#333333]=AND(G5<>"",G5<DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY())))[/COLOR][/CODE
 
Upvote 0
for green use
=AND(G5< > "",G5>=DATE(YEAR(TODAY()),MONTH(TODAY())-9,DAY(TODAY())))
 
Last edited:
Upvote 0
Thank you, all worked.

Lastly (This is last bit i promise)

What would be the formula for the same principle but for different time scales. Its for different spreadsheets, i finished the 1 year one, but now i have to do the same but for 2, 3 and 5 years on each separate sheet

Required.....


When i enter a date and for the duration within 21 months i would like cell to it go green

When i enter a date and for the duration when its 21 - 24 months old then to go amber
When i enter a date and duration of 2 year passes then to go Red.
Also all future dates to go green

AND

When i enter a date and for the duration within 33 months i would like cell to it go green
When i enter a date and for the duration when its 33 - 36 months old then to go amber
When i enter a date and duration of 3 year passes then to go Red.
Also all future dates to go green

AND

When i enter a date and for the duration within 57 months i would like cell to it go green
When i enter a date and for the duration when its 57 - 60 months old then to go amber
When i enter a date and duration of 5 year passes then to go Red.
Also all future dates to go green

Thank you in advance
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top