How to Apply Green, Amber, Red Date-Based Conditional Formatting in Excel
Question details
The user wants to dynamically color Excel records based on how many days have passed since a specific referral date.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Tracking aging records or deadlines by applying conditional formatting rules based on elapsed days.
- Observed behavior
- Records need to automatically turn green after two days, amber after three days, and red after five days.
Ensure that your referral dates are properly formatted as dates in Excel, and identify the exact column containing these dates to apply the correct formula references.
Use Conditional Formatting Formulas
Apply multiple formula-based conditional formatting rules and arrange them in the correct hierarchy to color-code rows based on elapsed time.
When dealing with overlapping date conditions, rule order is critical. You must ensure the rule with the longest duration (Red) is evaluated first or placed at the top of the rules list to prevent the shorter durations from overriding it.
Highlight the cell range you want to format (e.g., A2:D100). For these formulas, we will assume your referral dates are located in column D.
Go to the 'Home' tab, click 'Conditional Formatting', and select 'New Rule'. Choose 'Use a formula to determine which cells to format'. Enter =AND($D2<>"",$D2<TODAY()-2). Click 'Format', choose a Green fill color, and click OK.
Repeat the previous step to create a second rule. Enter the formula =AND($D2<>"",$D2<TODAY()-3). Click 'Format', choose an Amber fill color, and click OK.
Create a third rule by entering the formula =AND($D2<>"",$D2<TODAY()-5). Click 'Format', select a Red fill color, and click OK.
Navigate to 'Conditional Formatting' > 'Manage Rules'. Use the up and down arrows to move the Red rule to the very top, followed by the Amber rule, and then the Green rule at the bottom. Check the 'Stop If True' box for the Red and Amber rules.

Apply Conditional Formatting Easily with WPS Spreadsheet
WPS Office provides an intuitive interface for managing complex conditional formatting rules. You can quickly set up date-based formulas and prioritize them using the Manage Rules dialogue exactly as you would in Microsoft Excel.
- 1. Open your file in WPS: Launch WPS Spreadsheet and open your document containing the referral dates, then select your data range.
- 2. Add formatting rules: Go to the Home tab, click on Conditional Formatting, and select New Rule.
- 3. Input the TODAY() formula: Select 'Use a formula to format cells', input your date-tracking formula (e.g., $D2<TODAY()-5), and pick your desired color.
- 4. Prioritize your rules: Open Conditional Formatting > Manage Rules to arrange your red, amber, and green rules in the correct order.

Frequently Asked Questions
Why are my cells turning green instead of red for older dates?
This happens when the green rule (> 2 days) is placed above the red rule (> 5 days) in the Conditional Formatting Rules Manager. Because Excel evaluates rules from top to bottom, it colors the cell green as soon as the 2-day condition is met. To fix this, open 'Manage Rules' and move the red rule to the top.
Does the TODAY() function update automatically?
Yes, the TODAY() function dynamically updates to the current date every time the worksheet is opened or recalculated, ensuring your conditional formatting colors are always accurate based on the current day.
Can I apply this conditional formatting to the entire row instead of just one cell?
Yes. By using a mixed absolute reference in your formula (such as $D2 instead of D2), you lock the column reference. If you highlight the entire row range before creating the rule, the formatting will apply to all selected columns based exclusively on the date value in column D.




