Conditional formatting to 'traffic light' a review date

VMerry

New Member
Joined
Jun 16, 2013
Messages
4
Hello,

I am using Excel 2007 and have a set of review dates for a number of people. Each person must have their next review within 10-12 weeks. I'm trying to set a conditional format on the next review date with the following;

* if less than 90 days - highlights green
* if less than 40 days - highlights amber
* if less than 20 days - highlights red

I've been reading help pages and playing around for a while now. I've tried a number of formulae within the conditional formatting, the closest I managed was with the series below but I only seem to get the cells to highlight red once they are all entered.

=OR(TODAY()-$N$2<=-90,$P$2<>"")
=AND(TODAY()-$N$2>-40,TODAY()-$N$2<0)
=TODAY()-$N$2>0

I'm well and truly stuck so any help would be gratefully received!

Thanks for taking the time to read this :)
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
If you are willing to try a macro, this might do it assuming your dates are in column N.
Code:
Sub Test()
    Dim bottomN As Integer
    bottomN = Range("N" & Rows.Count).End(xlUp).Row
    Dim x As Long
    For x = bottomN To 2 Step -1
        If Cells(x, "N") - Date > 40 And Cells(x, "N") - Date <= 90 Then
            Cells(x, "N").Interior.ColorIndex = 4
        ElseIf Cells(x, "N") - Date > 20 And Cells(x, "N") - Date <= 40 Then
            Cells(x, "N").Interior.ColorIndex = 6
        ElseIf Cells(x, "N") - Date > 0 And Cells(x, "N") - Date <= 20 Then
            Cells(x, "N").Interior.ColorIndex = 3
        End If
    Next x
End Sub
 
Upvote 0
What date is in column N? Is it the date the review is going to happen? Is it the date of the last review?
What's in column P?
Which column do you want the conditional formatting to appear in?
 
Upvote 0
What date is in column N? Is it the date the review is going to happen? Is it the date of the last review?
What's in column P?
Which column do you want the conditional formatting to appear in?

Hi p45cal,

Column N is the date of the last review, column P is the date of the planned review (12 weeks after). I was hoping to make column P a traffic light system but couldn't make it work so thought I would settle for column O changing colour?

I'm open to suggestions is some part of the row will highlight when the review is imminent.

Thanks, VMerry :)
 
Upvote 0
Hi Mumps,

I've seen macro's before but never done one myself. I'll play around and see if I can get it to do the job :)
Thanks for the idea!

VMerry
 
Upvote 0
Excel Workbook
P
1planned review
208/03/2013
314/03/2013
420/03/2013
526/03/2013
601/04/2013
707/04/2013
813/04/2013
919/04/2013
1025/04/2013
1101/05/2013
1207/05/2013
1313/05/2013
1419/05/2013
1525/05/2013
1631/05/2013
1706/06/2013
1812/06/2013
1918/06/2013
2024/06/2013
2130/06/2013
2206/07/2013
2312/07/2013
2418/07/2013
2524/07/2013
2630/07/2013
2705/08/2013
2811/08/2013
2917/08/2013
3023/08/2013
3129/08/2013
3204/09/2013
3310/09/2013
3416/09/2013
3522/09/2013
3628/09/2013
3704/10/2013
3810/10/2013
3916/10/2013
Sheet
Cells with Conditional Formatting
CellConditionCell FormatStop If True
P21. / Cell Value less than =TODAY()+20Abc
P22. / Cell Value less than =TODAY()+40Abc
P23. / Cell Value less than =TODAY()+90Abc


When adding CF, choose the Format only cells that contain option (because we're highlighting the cells that themselves contain the planned date), then in Format only cells with: fields use Cell Value, less than, the formula in the screenshot above respectively for each of the three colours, in that order, and don't have the Stop if true checkboxes checked.
 
Upvote 0

Forum statistics

Threads
1,215,522
Messages
6,125,312
Members
449,218
Latest member
Excel Master

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