Excel guide · 4 min read
Highlight overdue and upcoming dates in Excel
=AND(B2<>"",B2<TODAY()) with a red fill. For dates due in the next 7 days, add a second rule: =AND(B2>=TODAY(),B2<=TODAY()+7) with an amber fill.Sample data
Every result on this page was calculated from this sheet by the same spreadsheet engine the Cellwise app uses.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Task | Due date | Status | Owner | Today | |
| 2 | Renew insurance | Oct 28, 2026 | Open | Sam | Nov 2, 2026 | |
| 3 | Send Q3 invoices | Oct 31, 2026 | Done | Ravi | ||
| 4 | Book venue | Nov 2, 2026 | Open | Mia | ||
| 5 | Payroll review | Nov 5, 2026 | Open | Sam | ||
| 6 | Website copy | Not started | Ravi | |||
| 7 | Supplier call | Nov 9, 2026 | Open | Mia | ||
| 8 | Year-end plan | Nov 30, 2026 | Open | Sam | ||
| 9 | Fix printer | Oct 15, 2026 | Open | Ravi |
Download this sheet as an Excel practice file (.xlsx)
Create the overdue rule
A formula rule is written for the first cell of the selection and Excel adjusts it for every other cell, the same way a formula fills down. That is why the rule says B2 even though it colors B2 to B9.
TODAY() updates whenever the workbook recalculates, so the colors move on by themselves each morning. In the formula results below, cell F2 stands in for TODAY() so the examples stay fixed at November 2, 2026.
- Select B2:B9, starting from B2 so it is the active cell.
- Home > Conditional Formatting > New Rule.
- Choose "Use a formula to determine which cells to format".
- Type
=AND(B2<>"",B2<TODAY()). - Click Format, pick a red fill on the Fill tab, then OK twice.
Why blank dates turn red
The obvious rule =B2<TODAY() colors empty cells too. Excel treats an empty cell as 0 in a comparison, and 0 is earlier than any real date. The Website copy task has no due date yet, but the simple rule flags it as overdue.
Adding B2<>"" inside AND fixes this. Check it on row 6: the result is FALSE, so the empty cell stays white.
Result: FALSE
FALSE for the blank due date in B6. The plain rule =B6<$F$2 returns TRUE and would color it red.
Add a "due in the next 7 days" rule
Select B2:B9 again and add a second formula rule with an amber or yellow fill. It catches today and the next seven days. Change 7 to 14 or 30 for a longer warning window.
Today's date itself falls in this rule, not the overdue rule, because the overdue rule uses "less than today". The Supplier call on November 9 is exactly 7 days away, so it is included.
Result: TRUE
TRUE for the Supplier call due November 9. The Year-end plan on November 30 returns FALSE and stays uncolored.
Ignore tasks that are done
A paid invoice or a finished task should not stay red. Add the status test to the rule and point it at column C with a $ before the column letter. In the real rule you would write =AND($B2<>"",$B2<TODAY(),$C2<>"Done").
Send Q3 invoices was due October 31 but is marked Done, so it stays white. Renew insurance is still Open, so it turns red.
Result: TRUE
TRUE for Renew insurance (due October 28, still Open). The same rule on row 3 returns FALSE because that task is Done.
Color the whole row, not just the date
Select A2:D9 instead of B2:B9, and lock the column in the rule: =AND($B2<>"",$B2<TODAY(),$C2<>"Done"). The $ keeps every cell in the row looking at column B and C, while the row number still moves down. Without the $, the references shift with each column: cell C2 would test D2 and E2 instead of B2 and C2, and the colors would scatter.
If two rules both apply, the one higher in Home > Conditional Formatting > Manage Rules wins for any format they both set. Keep the red overdue rule above the amber one.
The quick built-in option, and counting the red cells
Home > Conditional Formatting > Highlight Cells Rules > A Date Occurring offers Yesterday, Today, Tomorrow, In the last 7 days, Last week, This week, Next week, Last month, This month and Next month. It needs no formula, but it has no "overdue" or "next 30 days" choice, so most trackers need the formula rules above.
Conditional formatting cannot be counted directly. Count with the same logic instead, using COUNTIFS. It skips blank dates on its own, because an empty cell is not a date.
Result: 2
2 open tasks are overdue: Renew insurance and Fix printer. With "<"&TODAY() in place of F2 it updates daily.
Common mistakes
Every empty row is red
Empty cells count as 0, which is an old date. Use =AND(B2<>"",B2<TODAY()).
Colors in the wrong rows
The rule must refer to the first row of the selection (row 2 here). If you selected from B1 or from the bottom up, edit the rule in Manage Rules.
Some dates never highlight
They are text, not real dates. Text sits on the left of the cell and COUNT ignores it. Convert the column with Data > Text to Columns > Finish.
Only the first column of the row is colored
Add $ before the column letter: $B2 and $C2, so every cell in the row tests the same columns.
FAQ
How do I highlight dates before today in Excel?
Select the dates, choose Home > Conditional Formatting > New Rule > Use a formula, and enter =AND(B2<>"",B2<TODAY()) with a fill color. Change B2 to the first cell of your selection.
How do I highlight dates within 30 days in Excel?
Use the formula rule =AND(B2>=TODAY(),B2<=TODAY()+30). It colors dates from today up to 30 days ahead.
How do I highlight a row if the date is overdue?
Select the whole table without headers and use =AND($B2<>"",$B2<TODAY()), with $ before the date column letter so every cell in the row checks the same date.
Does conditional formatting with TODAY update automatically?
Yes. TODAY() recalculates when you open the workbook or anything changes, so tomorrow the colors reflect tomorrow's date.
Functions used
Related guides
- How to calculate due dates and days overdue in Excel
- Countdown in Excel: how many days until a date
- How to find duplicates in Excel
- Absolute vs relative cell references in Excel
- Excel formulas cheat sheet: the 25 everyone should know
- How to use COUNTIF greater than in Excel
Updated