Formatting Issues

Highlight Past and Current Dates in Excel with Conditional Formatting

Nimra MalikNimra Malik Dec 2, 2026 869 views

Question details

Automatically highlight dates that are today or earlier without formatting blank cells.

Highlight Past and Current Dates in Excel with Conditional Formatting
Product
Microsoft Excel
Device & OS
not provided
Scenario
A user wants a date range to update its highlighting automatically as the current date changes.
Observed behavior
Dates up to and including today should be highlighted, while blank cells remain unformatted.
Before you start

Identify the date range and its top-left cell; the formula must refer to that cell. Make sure the entries are recognized as dates rather than text.

Solution 1Recommended

Create a formula rule that excludes blank dates

Use this rule to highlight dates through today and leave blank cells unformatted.

1
Select the date range

Select the cells containing your dates, such as B2:B100. Keep B2 as the active cell when creating the rule.

2
Create a formula rule

On the Home tab, select Conditional Formatting > New Rule, then choose Use a formula to determine which cells to format.

3
Enter the formula

Enter =AND(B2<>"",B2<=TODAY()). Replace B2 with the top-left cell of your selected range, and leave the reference relative so the rule adjusts for each cell.

4
Choose the highlight

Select Format, choose a fill or other formatting, and click OK twice to apply the rule.

5
Check rule priority

Open Home > Conditional Formatting > Manage Rules and check the Applies to range. If another rule overrides the date rule, adjust the rule order or its Stop If True setting.

Create a formula rule that excludes blank dates
Dates that include times: If cells contain times as well as dates, use =AND(ISNUMBER(B2),B2<TODAY()+1) instead. This includes all times today and excludes blanks.
WPS Spreadsheet

Highlight Due Dates Automatically in WPS Spreadsheet

Use a formula-based conditional formatting rule in WPS Spreadsheet to highlight dates through today while leaving blank cells unformatted.

  1. 1. Open the spreadsheet: Open WPS Spreadsheet and use Open to select your Excel workbook.
  2. 2. Select the dates: Select the date range, such as B2:B100, with B2 as its first cell.
  3. 3. Add a formula rule: Choose Home > Conditional Formatting > New Rule, select the formula-based rule option, and enter =AND(B2<>"",B2<=TODAY()). Replace B2 with the first cell of your range.
  4. 4. Apply the format: Choose Format, select a highlight style, and confirm the rule. Save the workbook using File > Save.
Automatically highlights dates as the current day changesKeeps blank cells outside the date ruleCompatible with Microsoft Excel XLSX and XLS filesFamiliar spreadsheet interface with a free option
microsoft office alternative - wps office

Frequently Asked Questions

Why are blank cells being highlighted by my date rule?

A simple Cell Value rule can treat blanks like zero. Create a formula rule under Home > Conditional Formatting > New Rule and use =AND(B2<>"",B2<=TODAY()), adjusting B2 to the first cell in your range.

How do I highlight only dates before today?

In your formula-based conditional formatting rule, use =AND(B2<>"",B2<TODAY()). Replace B2 with the first cell of the selected range.

Why isn't a date with today's date highlighted?

The cell may contain a time after midnight or a date stored as text. For date-and-time values, use =AND(ISNUMBER(B2),B2<TODAY()+1); for text dates, convert them to recognized Excel dates.

Will the highlighting change automatically tomorrow?

Yes. TODAY() uses the current date when the workbook recalculates. If the highlighting does not update, check Formulas > Calculation Options and select Automatic.