Highlight Dates Expiring in the Next 30 Days

Excel Formulas › Conditional Formatting

All versions

Certifications, contracts, and warranties all expire. A conditional-formatting rule paints anything due in the next 30 days so nothing slips through.


Quick formula: Use this as a conditional-formatting formula rule on your date column:
=AND(A2>=TODAY(),A2<=TODAY()+30)

Set a yellow or amber fill; rows expiring within 30 days light up automatically.

Functions used (tap for the full reference guide):

The example

A list of certifications with expiry dates. Anything due within 30 days of today should stand out.

AB
1ItemExpires
2Forklift certin 12 days
3First aidin 90 days
4Licensein 5 days

The formula

The rule tests two things at once with AND: the date is still in the future, and it is no more than 30 days away:

=AND(A2>=TODAY(),A2<=TODAY()+30) // future, and within the next 30 days

How it works

Setting it up:

  1. Select the data column (for example A2:A100), then Home → Conditional Formatting → New Rule → Use a formula.
  2. Enter the formula referencing the first cell of the selection (A2) with no row lock.
  3. TODAY() recalculates every day, so the highlight window slides forward automatically.
  4. Pick a fill colour and click OK; the rule applies to every selected row relative to its own date.

Add a second rule with =A2<TODAY() in red to flag items that have already expired.

Try it: interactive demo

Interactive

Enter how many days until an item expires; see whether the 30-day rule highlights it.

Variations

Expiring this week (7 days)

Tighten the window for a weekly review.

=AND(A2>=TODAY(),A2<=TODAY()+7)

Already expired

A separate red rule for past dates.

=A2<TODAY()

Pitfalls & errors

Lock the column but not the row ($A2) if you want to colour the entire row instead of just the date cell.

Order matters: put the "expired" red rule above the "due soon" amber rule, or check Stop If True.

Practice workbook

📊
Download the free Highlight Dates Expiring in the Next 30 Days practice workbook
Change the yellow expiry dates; the Days Left and Status columns update against today.

Frequently asked questions

Will the colours update by themselves?
Yes. TODAY() recalculates each time the workbook opens or recalculates, so the 30-day window always reflects the current date.
Can I colour the whole row, not just the date?
Select the full row range and lock only the column in the formula, e.g. =AND($A2>=TODAY(),$A2<=TODAY()+30).
Why is nothing highlighting?
The cells may be text that looks like dates. Confirm they are real dates (right-aligned by default) before the rule can compare them.

Stop fighting formulas. Learn them in a day.

This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related formulas: Days until a deadline · Add business days to a date

Function references: TODAYIF