How to Highlight Excel Rows Based on Rental End Dates
Question details
The user wants to automatically highlight rows in an Excel spreadsheet based on approaching or expired rental end dates without affecting blank cells.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Managing equipment rentals and visually tracking approaching return dates or expired rentals using color-coded rows.
- Observed behavior
- Needs to apply an accurate conditional formatting formula that calculates the difference between a rental's end date and today's date to trigger row highlighting.
Ensure your rental end dates in the spreadsheet are formatted as valid Excel dates rather than plain text, otherwise the date formulas will not calculate correctly.
Use the TODAY() Formula to Highlight Upcoming Expirations
Apply a basic conditional formatting formula to highlight rows whose rental end dates are approaching within a specific number of days.
You can use a combination of the AND() and TODAY() functions to check if a date is within a certain timeframe. Adding a condition to check if the cell is greater than 0 prevents blank cells from being highlighted.
Highlight the rows or columns you want to format, starting from the first row of your data (e.g., Row 1 or Row 2, excluding headers if preferred).
Navigate to the 'Home' tab on the top ribbon, click on 'Conditional Formatting', and select 'New Rule' from the drop-down menu.
Choose the option 'Use a formula to determine which cells to format'. In the formula box, enter `=AND($A1>0,$A1-TODAY()<5)`. Replace '$A1' with the exact cell reference of your first date, keeping the dollar sign to lock the column.
Click the 'Format' button, switch to the 'Fill' tab, choose a highlight color like yellow or red, and click 'OK' to apply your new rule.

Set Tiered Rules Using the DAYS() Function
Create multiple conditional formatting rules to apply different colors for expired rentals and various approaching deadlines.
Highlight Date Expirations Easily in WPS Spreadsheet
WPS Spreadsheet fully supports advanced conditional formatting and dynamic date functions like TODAY() and DAYS(). You can easily track rental expirations and manage large datasets seamlessly without any subscription fees.
- 1. Select Data: Open your rental tracking file in WPS Spreadsheet and highlight the data range to format.
- 2. Open Conditional Formatting: Go to the 'Home' tab, click 'Conditional Formatting', and select 'New Rule'.
- 3. Apply Formula: Select 'Use a formula to determine which cells to format', input your date-tracking formula (like `=DAYS($A2,TODAY())<5`), choose a fill color, and click 'OK'.

Frequently Asked Questions
Why are blank cells getting highlighted by my date formula?
Excel treats empty cells as a value of zero (which corresponds to a date in 1900). Because 1900 is far less than today's date, it triggers the highlighting rule. Including a condition like `$A1>0` in an AND() statement forces the rule to ignore empty cells.
Can I apply conditional formatting to the entire row instead of just the date cell?
Yes. To highlight the entire row, you must select the full range of columns (e.g., A2:F100) before creating the rule. Most importantly, use an absolute column reference for the date cell in your formula by placing a dollar sign before the column letter (e.g., `$C2`), while leaving the row number relative.
Does the TODAY() function update automatically?
Yes, the TODAY() function is volatile and updates automatically to the current system date whenever the workbook is opened or recalculated. This ensures your highlighted rows continually reflect the correct approaching deadlines.
Why is my conditional formatting highlighting the wrong rows?
This usually happens when the row number referenced in your formula does not match the topmost row of the range you selected. If you selected A2:E50, your formula must reference row 2 (e.g., `$A2`), not row 1.




