Sub topic 3
Highlighting Dates and Deadlines
Assume you can enter dates, select ranges, and write simple formulas. Conditional formatting can highlight deadlines automatically as dates change.
Highlighting dates and deadlines
Select the date range, such as D2:D100, then choose Home > Conditional Formatting > Highlight Cells Rules > A Date Occurring. Choose options such as yesterday, today, tomorrow, or next week.
For row-level formatting, select the complete table range, such as A2:E100, and create a formula rule. The formula must describe the first row of the selected range:
=AND($D2<TODAY(),$E2<>"Done")This highlights overdue rows when the date in column D has passed and the status in column E is not Done. The dollar sign locks the columns while the row number changes for each row.
To highlight deadlines within the next seven days, use:
=AND($D2>=TODAY(),$D2<=TODAY()+7,$E2<>"Done")Reviewing and editing rules in the Rules Manager
Choose Home > Conditional Formatting > Manage Rules. Set Show formatting rules for to This Worksheet to review rules across the sheet. Check each rule's:
- Rule description
- Applies to range
- Format
- Formula
- Order
Use Edit Rule to change the formula or appearance. Use the range selector beside Applies to to correct the covered cells.
Rule order, conflicts and Stop If True
Rules are evaluated from top to bottom. If two rules apply different formats, the higher rule usually controls the conflicting format property. Move a rule up or down with the arrow buttons.
Enable Stop If True when an earlier rule should prevent later rules from being evaluated for the same cell. For example, put a critical overdue rule above a general alternating-row rule.
Copying, clearing and troubleshooting
Copy formatting with Home > Format Painter, or copy the source cells and use Paste Special > Formats. To remove rules, choose Conditional Formatting > Clear Rules, then clear rules from the selected cells or the entire sheet.
If a rule does not work, check that:
- The Applies to range is correct.
- The formula starts with the first row of that range.
- Text matches exactly, including spaces and capitalization where relevant.
- Dates are real date values, not text that only looks like a date.
- Absolute and relative references point to the intended columns and rows.
- An earlier rule or Stop If True is not overriding the result.
Exercise
A table starts at A2. Which formula highlights rows with a past date in D and an unfinished status in E?
Show answer
=AND($D2<TODAY(),$E2<>"Done")