Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel Conditional Formatting Dates Older Than: How-To

· 5 min read · Home Tech

In this article
  1. Formula
  2. Worked Example
  3. How to Set Up the Rule (Step-by-Step)
  4. Using the “Format Only Cells That Contain” Option
  5. Common Mistakes and How to Avoid Them
  6. Alternatives and Variations
  7. Frequently Asked Questions

Excel conditional formatting for dates older than a certain number of days highlights cells whose date falls before a cutoff you specify. You enter a date or a number of days, and Excel paints the cells that meet the condition, making overdue items, expired dates, and old records instantly visible. This guide explains how to set it up, how the rules work, and how to avoid common mistakes.

in t | Days | days | 30 | 0
in d | Reference date | date | =TODAY() | 0
out age | Age in days | days | t | 0

Formula

The core formula for “older than X days” compares a date cell to the current date minus X days. In Excel, dates are stored as serial numbers, so you can subtract days directly. The condition is:

=A1 < TODAY() - 30

Where:

  • A1 is the first cell in your selected range (adjust to your data).
  • TODAY() returns the current date (updates daily).
  • 30 is the number of days you choose; replace with any positive number.

The rule highlights any cell whose date is earlier than the cutoff. If you want “older than” to include today’s date minus 30 days exactly, use <= instead of <.

Worked Example

Suppose you have a list of invoice dates in cells A2:A100 and you want to highlight invoices older than 30 days. Using the default values from the calculator (30 days, reference date = today):

  1. Select the range A2:A100.
  2. Go to Home > Conditional Formatting > New Rule.
  3. Choose Use a formula to determine which cells to format.
  4. Enter the formula: =A2 < TODAY() - 30 (note: use the first cell of your selection, without the $ sign for the row).
  5. Click Format, choose a fill color, and click OK.

If today is 2025-04-10, the cutoff is 2025-03-11. Any invoice dated 2025-03-10 or earlier gets highlighted. The formula recalculates each day, so the highlight automatically updates as time passes.

How to Set Up the Rule (Step-by-Step)

  1. Select the cells that contain dates (e.g., A2:A100).
  2. On the Home tab, click Conditional Formatting > New Rule.
  3. Select Use a formula to determine which cells to format.
  4. In the formula box, type the formula using the first cell of your selection (e.g., =A2 < TODAY() - 30).
  5. Click Format, go to the Fill tab, pick a color, and click OK.
  6. Click OK again to apply the rule.

To highlight entire rows based on a date in one column, use a mixed reference: select the whole data range (e.g., A2:F100) and enter a formula like =$A2 < TODAY() - 30 (with the dollar sign before the column letter).

Using the “Format Only Cells That Contain” Option

Excel also offers a built-in rule for dates without writing a formula. Go to Conditional Formatting > Highlight Cells Rules > A Date Occurring. This lets you pick options like “older than” and then enter a number of days, weeks, or months. However, this built-in option is less flexible—it only works with the current date and doesn’t allow you to reference another cell. For most “older than” needs, the formula method gives you more control.

Common Mistakes and How to Avoid Them

  • Wrong cell reference in the formula: The formula must reference the first cell of your selected range. If you select A2:A100, the formula should be =A2<TODAY()-30, not =A1. Excel adjusts the reference for each cell automatically.
  • Missing absolute reference for rows: If you want to highlight whole rows, use =$A2 (column locked, row relative). Without the $, the rule will check the wrong column for each row.
  • Dates stored as text: If your “dates” are actually text (e.g., “2025-03-10” as a string), the comparison won’t work. Convert them to real dates using the DATEVALUE function or the Text to Columns wizard.
  • Using < vs. <= incorrectly: Decide whether you want to include the exact cutoff date. Use < for “strictly older” and <= for “older than or equal to.”
  • Forgetting that TODAY() updates: The rule is dynamic; it will change as days pass. If you want a static cutoff, replace TODAY() with a fixed date like DATE(2025,3,11).

Alternatives and Variations

  • Highlight dates older than a specific date: Use =A2 < DATE(2025,3,11) instead of TODAY().
  • Highlight dates older than N days from another cell: Put the number of days in a cell (e.g., B1) and use =A2 < TODAY() - $B$1.
  • Highlight dates older than 30 days but not older than 60 days: Use =AND(A2 < TODAY()-30, A2 >= TODAY()-60).
  • Use a color scale to show relative age: Instead of a formula, use Conditional Formatting > Color Scales to shade dates by how old they are.
  • Highlight weekends or specific weekdays: Use =WEEKDAY(A2,2)>5 for weekend dates.

Frequently Asked Questions

How do I highlight dates older than 30 days in Excel?

Select your date range, go to Conditional Formatting > New Rule > Use a formula, and enter =A2 < TODAY()-30 (adjust A2 to the first cell). Choose a format and click OK. The rule will highlight any date that is more than 30 days before today.

Why is my conditional formatting not working for dates?

The most common cause is that your dates are stored as text. Check by selecting a cell and looking at the Number Format. If it says “Text,” convert to a date using DATEVALUE or Text to Columns. Also, ensure the formula references the correct first cell and that the range is selected correctly.

Can I highlight a whole row based on a date in one column?

Yes. Select the entire data range (e.g., A2:F100) and use a formula with a mixed reference like =$A2 < TODAY()-30. The dollar sign locks the column, so the rule checks the date in column A for each row, but highlights the entire row.

How do I make the cutoff date static instead of always today?

Replace TODAY() with a fixed date using the DATE function, e.g., =A2 < DATE(2025,3,11). This will keep the cutoff constant regardless of the current date.

Does conditional formatting update automatically as days pass?

Yes, if you use TODAY() in the formula. Excel recalculates formulas when the workbook opens or when changes are made, so the highlighting will reflect the new date each day. If it doesn’t update, press F9 to force a recalculation.

Can I use “older than” with months or years instead of days?

Yes. Use the EDATE function for months: =A2 < EDATE(TODAY(), -3) for older than 3 months. For years, use =A2 < EDATE(TODAY(), -12*2) for 2 years. For days, simply subtract the number of days from TODAY().