Excel Traffic Light Conditional Formatting Dates
In this article
Excel traffic light conditional formatting for dates lets you color-code cells based on how close a date is to today, so you can instantly see which tasks are overdue, due soon, or on track. You set up rules that compare each date to the TODAY() function and apply green, yellow, or red fills. This guide explains how to build those rules, what each color should mean, and how to avoid common mistakes.
in t | Finish time | min | 50 | 0 in d | Distance | km | 10 | 0 out pace | Average pace | min/km | t / d | 2 out speed | Average speed | km/h | d / (t / 60) | 2
Formula
The core of traffic light formatting is comparing a date cell to the current date using the TODAY() function. You write three conditional formatting rules, each with its own formula:
- Red (overdue):
=A2<TODAY()– the date is before today. - Yellow (due soon):
=AND(A2>=TODAY(), A2<=TODAY()+7)– the date is today or within the next 7 days. - Green (on track):
=A2>TODAY()+7– the date is more than 7 days in the future.
Here A2 is the first cell in your selected range. The TODAY() function returns the current date, and you can add or subtract days to set the “due soon” window. The formulas return TRUE or FALSE, and Excel applies the formatting when the formula is TRUE.
Worked Example
Suppose you have a task list with due dates in column A, starting at A2. Today is 2025-01-10. You want red for overdue, yellow for due within 7 days, and green for anything later.
- Select A2:A20.
- Go to Home → Conditional Formatting → New Rule → Use a formula to determine which cells to format.
- Enter
=A2<TODAY(), click Format, choose a red fill, and click OK. - Create a second rule with
=AND(A2>=TODAY(), A2<=TODAY()+7)and a yellow fill. - Create a third rule with
=A2>TODAY()+7and a green fill.
With today’s date of 2025-01-10, a cell with 2025-01-05 turns red, 2025-01-12 turns yellow, and 2025-01-20 turns green. The formulas update automatically when you open the file on a later date, so the colors always reflect the current day.
Why Use Traffic Light Formatting for Dates?
Traffic light formatting turns a column of raw dates into a visual dashboard. Instead of scanning each date and mentally calculating how far away it is, you can glance at the colors and immediately know which tasks need attention. This is especially useful for project timelines, invoice due dates, subscription renewals, employee review dates, or any list where deadlines matter.
The three-color system works because humans process color faster than numbers. Red draws the eye to problems, yellow flags upcoming items, and green reassures you that things are under control. You can also add a fourth color for “no date” or “completed” if your data includes blanks or status columns.
How to Set Up the Rules (Step by Step)
Here is the exact process for Excel 2016, 2019, 2021, and Microsoft 365:
- Select the range of date cells (e.g., A2:A100). Make sure the top-left cell of the selection is the cell referenced in your formulas.
- On the Home tab, click Conditional Formatting → New Rule.
- Choose Use a formula to determine which cells to format.
- Type the formula for the first color (e.g.,
=A2<TODAY()). - Click Format, go to the Fill tab, pick a color, and click OK.
- Repeat for the other two rules. Make sure the rules are in the correct order (red first, then yellow, then green) so that overlapping conditions work as intended.
- Click OK to apply.
If you want the entire row to change color based on the date in one column, select the whole data range (e.g., A2:F100) and use a formula with a mixed reference like =$A2<TODAY(). The dollar sign locks the column but lets the row adjust for each row.
Choosing the Right Color Thresholds
The 7-day window in the example is arbitrary. You should set thresholds that match your workflow. For instance:
- Red: Overdue (date < TODAY()).
- Yellow: Due within 3 days (date <= TODAY()+3).
- Green: Due after 3 days (date > TODAY()+3).
Or you might want a 30-day warning for long-term projects. The key is to define “soon” in a way that makes sense for your tasks. You can also use WEEKDAY() to skip weekends, but that adds complexity. For most users, a simple day count is sufficient.
One common mistake is using NOW() instead of TODAY(). NOW() includes the current time, so a date that is today but before the current time will be treated as overdue. Use TODAY() when you only care about the date, not the time.
Common Problems and How to Fix Them
Several issues can cause traffic light formatting to behave unexpectedly:
- Dates are stored as text. If your cells contain text like “Jan 5, 2025” instead of real dates, the comparison won’t work. Convert them using Data → Text to Columns or the
DATEVALUE()function. - Blank cells turn red. A blank cell is treated as 0, which is less than TODAY(), so it gets flagged as overdue. Add a rule to ignore blanks, or use a formula like
=AND(A2<>"", A2<TODAY()). - Rules are in the wrong order. If you put the green rule first and it overlaps with yellow, the green might override the yellow. Order matters: red first, then yellow, then green.
- Formulas use relative references incorrectly. When you select a range, the formula should reference the top-left cell of that range. If you start the selection at A2, use A2 in the formula. If you start at B2, use B2.
- Colors don’t update when the date changes. Conditional formatting recalculates when the workbook recalculates. If you have manual calculation mode, press F9 to force a refresh.
Comparing with Icon Sets and Color Scales
Excel also offers built-in conditional formatting options like icon sets and color scales. Icon sets can show a traffic light icon (red, yellow, green circle) based on a cell’s value, but they work best with numeric values, not dates. You can use a formula to convert dates to numbers, but it’s often easier to use the fill color method described here.
Color scales (e.g., green-yellow-red gradient) are useful for spotting trends across a range of dates, but they don’t let you set specific thresholds. For deadline tracking, the three-rule approach gives you precise control.
Cost and Alternatives
Conditional formatting is a built-in feature in all desktop versions of Excel, including Excel for Microsoft 365, Excel 2021, 2019, and 2016. There is no extra cost. If you don’t have Excel, Google Sheets offers the same functionality with the TODAY() function and custom formulas under Format → Conditional formatting. The rules are nearly identical, so you can apply the same logic there.
Frequently Asked Questions
How do I make the entire row change color based on a date?
Select the whole data range (e.g., A2:F100) and use a formula with a mixed reference like =$A2<TODAY(). The dollar sign locks the column, so the rule checks the date in column A for each row, and the formatting applies to all selected cells in that row.
Why is my overdue date not turning red?
Check that the cell contains a real date, not text. Also verify that the formula references the correct cell (the top-left cell of your selection). If you have a green rule before the red rule, it might override the red. Move the red rule to the top in the Conditional Formatting Rules Manager.
Can I use conditional formatting to highlight weekends?
Yes, use a formula like =OR(WEEKDAY(A2)=1, WEEKDAY(A2)=7) to highlight Saturdays and Sundays. This is independent of the traffic light rules, so you can add it as a separate rule.
Does the formatting update automatically each day?
Yes, as long as the workbook recalculates. Excel recalculates when you open the file and when you change any cell. If you leave the file open overnight, it may not update until you trigger a recalculation (e.g., press F9 or edit a cell).
How do I remove the traffic light formatting?
Select the range, go to Conditional Formatting → Clear Rules → Clear Rules from Selected Cells. This removes all conditional formatting from those cells.