Formatting Issues

How to Set Conditional Formatting for Dates Within 2 or 4 Years in Spreadsheets

Muhammad TalhaMuhammad Talha Nov 11, 2026 868 views

Question details

The user wants to apply conditional formatting to date cells to automatically highlight deadlines that fall within two or four years relative to the current date.

How to Apply Conditional Formatting for Dates Within 2 or 4 Years
Product
Spreadsheets
Device & OS
not provided
Scenario
Tracking upcoming project deadlines or document retention schedules using dynamic conditional formatting rules that update based on today's date.
Observed behavior
Date cells need to automatically change color to orange for approaching deadlines and red for critical deadlines within a specific 24-month or 48-month timeframe.
Before you start

Ensure your target cells are properly formatted as Dates rather than Text, otherwise the formula will not accurately calculate the timeframes.

Solution 1Recommended

Apply Conditional Formatting Using the EDATE and TODAY Functions

Use a formula-based rule within Conditional Formatting to dynamically calculate the 24-month or 48-month threshold relative to today.

The TODAY() function continuously updates to the current date, while EDATE calculates a date a specific number of months in the future. By combining these, you can create dynamic rules that automatically highlight approaching deadlines.

1
Select the Target Range

Highlight the date cells you want to format, such as D3:D100.

2
Create an Approaching Deadline Rule

Go to the Home tab, click 'Conditional Formatting', and select 'New Rule'. Choose 'Format only cells that contain', leave the first dropdown as 'Cell Value', and select 'less than or equal to'. Enter the formula =EDATE(TODAY(),48)+25 and set the fill color to orange.

3
Create a Critical Deadline Rule

Create a second rule for the same range using the same steps. This time, enter the formula =EDATE(TODAY(),48) and set the fill color to red.

4
Adjust for Two Years

To track a 2-year timeline (e.g., in column E), repeat the process using EDATE(TODAY(),24) for your critical deadline and EDATE(TODAY(),24)+25 for your approaching deadline.

5
Manage Rule Priority

Click 'Conditional Formatting' > 'Manage Rules'. Make sure override rules, such as a green formatting rule for a 'Completed' status, are moved to the top of the list so they take precedence over the date formatting.

Apply Conditional Formatting Using the EDATE and TODAY Functions
Rule Priority: Conditional formatting rules are evaluated in the order they appear in the Manage Rules dialog box. Place the most restrictive or important rules at the very top.
Efficient Spreadsheet Management

Manage Dynamic Date Deadlines in WPS Spreadsheets

WPS Spreadsheets fully supports advanced conditional formatting and dynamic date functions like EDATE and TODAY, allowing you to seamlessly track critical project milestones and expiration dates.

  1. 1. Open Your Spreadsheet: Launch WPS Spreadsheets and open the workbook containing your deadline tracker.
  2. 2. Select the Date Column: Highlight the column or range of dates you wish to monitor.
  3. 3. Apply Formatting: Navigate to Home > Conditional Formatting > New Rule and input your desired EDATE formula.
  4. 4. Manage Complex Rules: Use the Manage Rules option to add color scales or handle 'Completed' status overrides easily.
Fully compatible with Microsoft Excel conditional formatting rules and syntax.Built-in robust formula engine supporting EDATE, EOMONTH, and TODAY.User-friendly Manage Rules dialog to easily organize your formatting priorities.Lightweight, free to use, and offers a familiar interface.
microsoft office alternative - wps office

Frequently Asked Questions

Why are blank cells being highlighted as critical dates in my conditional formatting?

Blank cells are often interpreted by the system as zero, which equates to the year 1900. Since 1900 is less than today's date, the rule triggers. To fix this, create a new rule using the formula =ISBLANK(D3), set no formatting, place it at the top of your rules list, and check 'Stop If True'.

Can I use EOMONTH instead of EDATE for my deadlines?

Yes. If your deadlines always fall on the last day of the month, you can substitute EDATE with EOMONTH. For example, using =EOMONTH(TODAY(),48) will calculate the last day of the month exactly four years from today.

Why is my EDATE formula rule returning an error?

This usually happens when the cells are formatted as text rather than a date. Highlight the affected cells, right-click and select 'Format Cells', choose the 'Date' category, and re-enter your date values.