Formatting Issues

How to Highlight Excel Rows Based on Rental End Dates

Anum MushtaqAnum Mushtaq Oct 29, 2026 870 views

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.

How to Highlight Excel Rows Based on Rental End Dates
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.
Before you start

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.

Solution 1Recommended

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.

1
Select the target data range

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).

2
Open the Conditional Formatting menu

Navigate to the 'Home' tab on the top ribbon, click on 'Conditional Formatting', and select 'New Rule' from the drop-down menu.

3
Enter the custom date formula

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.

4
Apply a highlight color

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.

Use the TODAY() Formula to Highlight Upcoming Expirations
Row matching is critical: Make sure the row number in your formula (like $A1 or $A2) exactly matches the first row of your currently selected range, otherwise the formatting will misalign.
Manage Spreadsheet Data Effortlessly

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. 1. Select Data: Open your rental tracking file in WPS Spreadsheet and highlight the data range to format.
  2. 2. Open Conditional Formatting: Go to the 'Home' tab, click 'Conditional Formatting', and select 'New Rule'.
  3. 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'.
100% compatible with Microsoft Excel conditional formatting rules and custom formulas.Intuitive Rule Manager to easily view, edit, and prioritize multiple format conditions at once.Lightweight, fast performance for handling large tracking and rental sheets without lagging.Free to use with a familiar interface, requiring no learning curve for Excel users.
microsoft office alternative - wps office

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.