Fix Excel Conditional Formatting for Dates Older Than 30 Days
Question details
The user needs to highlight dates more than 30 days before today with an Excel conditional formatting rule.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Apply a date-based formatting rule to a range beginning at G2.
- Observed behavior
- The expression =G2[=TODAY()-30 contains an invalid comparison operator and cannot be used as written.
Identify the first cell in the range you want to format and check that the dates are stored as actual Excel dates rather than text. The examples below assume the range begins at G2.
Use a Formula Rule for Dates Older Than 30 Days
Use this rule to highlight numeric dates before the 30-day cutoff while ignoring blank and text cells.
Select the cells to format, such as G2:G1000, starting with G2.
On the Home tab, choose Conditional Formatting > New Rule, then select Use a formula to determine which cells to format.
Enter =AND(ISNUMBER(G2),G2<TODAY()-30). Keep G2 relative so Excel evaluates each row against its own date.
Select Format, choose a color on the Fill tab, and click OK. Click OK again to create the rule.
Open Conditional Formatting > Manage Rules and confirm that Applies to starts at G2, for example =$G$2:$G$1000. Remove the invalid rule if it is still present.

Use Excel's Built-In Cell Value Rule
Use the built-in comparison rule when you prefer not to write a formula that references each cell.
Highlight Older Dates in WPS Spreadsheets
Use a formula-based conditional formatting rule in WPS Spreadsheets to highlight dates before a rolling 30-day cutoff.
- 1. Open the spreadsheet: Open WPS Spreadsheets and use File > Open to select your workbook.
- 2. Select the date range: Select the cells you want to format, such as G2:G1000.
- 3. Add the formula rule: On the Home tab, open Conditional Formatting > New Rule, choose the formula-based rule, and enter =AND(ISNUMBER(G2),G2<TODAY()-30).
- 4. Choose a format: Click Format, choose a fill color, and confirm the rule. Check that its applied range starts at G2.

Frequently Asked Questions
Why does my conditional formatting formula fail?
The expression =G2[=TODAY()-30 contains an invalid operator. In Home > Conditional Formatting > Manage Rules, edit the rule and replace it with =AND(ISNUMBER(G2),G2<TODAY()-30) for a range starting at G2.
How do I include dates exactly 30 days old?
Use =AND(ISNUMBER(G2),G2<=TODAY()-30) in the formula rule. The <= operator includes the cutoff date.
Why are some dates not highlighted?
Check that the entries are actual date values, not text, and that the formula refers to the first cell in the applied range. Review the range under Home > Conditional Formatting > Manage Rules.
Will the highlighted dates change as time passes?
Yes. TODAY() uses the current date, so the cutoff moves as the workbook recalculates. If needed, use the Formulas tab to check Excel's calculation settings.




