Chart & Visualization Issues

How to Apply Conditional Formatting for Leave Dates Based on Status in Excel

Phi Hung VoPhi Hung Vo Nov 11, 2026 869 views

Question details

The user needs to create conditional formatting rules to highlight employee leave and return dates based on their status and how close the dates are to today.

How to Apply Conditional Formatting for Leave Dates Based on Status in Excel
Product
Excel
Device & OS
not provided
Scenario
Managing an employee leave schedule and wanting visual alerts for upcoming or past-due leave/return dates depending on the employee's current leave status.
Observed behavior
Dates need to automatically highlight in specific colors when certain date and status conditions are met, and clear the formatting when the status changes to returned.
Before you start

Ensure your employee leave tracking sheet has clear, dedicated columns for Employee Status (e.g., 'LOA-Active', 'LOA-Future', 'LOA-Returned'), Leave Date, and Return Date.

Solution 1Recommended

Set Up Formula-Based Conditional Formatting Rules

Use custom formulas within the conditional formatting tool to evaluate both the status column and the date column simultaneously.

To handle multiple conditions, such as checking if a status is 'LOA-Active' AND checking if the date is within 7 days of today, you must use the 'Use a formula to determine which cells to format' option.

1
Open the Conditional Formatting Menu

Select the Return Date column in your spreadsheet (e.g., Column L). Go to the Home tab on the ribbon, click Conditional Formatting, and select New Rule.

2
Enter the Formula for Upcoming Dates

Choose 'Use a formula to determine which cells to format'. To highlight active leave dates within the next 7 days, enter the formula: =AND($H2="LOA-Active", $L2>=TODAY(), $L2<=TODAY()+7). Click Format to choose a yellow Fill color, then click OK.

3
Create a Rule for Past Dates

Select the Return Date column again and create another New Rule. Use the formula: =AND($H2="LOA-Active", $L2<TODAY()) to target dates earlier than today. Click Format, set the Fill color to red, and click OK.

4
Set Up Rules for Future Leave

Select the Leave Date column (e.g., Column K). Add a new rule with the formula: =AND($H2="LOA-Future", $K2>=TODAY(), $K2<=TODAY()+7) and apply your preferred formatting. Highlights will automatically disappear when the status changes to 'LOA-Returned' since the status no longer matches your formulas.

Set Up Formula-Based Conditional Formatting Rules
Absolute and Relative References: Ensure you use a dollar sign ($) before the column letter (e.g., $H2) so the formula always checks the correct status column, even if the formatting is applied across multiple cells in a row.
Advanced Spreadsheet Formatting

Easily Manage Conditional Formatting in WPS Spreadsheet

WPS Spreadsheet provides a robust and intuitive Conditional Formatting tool, allowing you to easily track employee leave statuses, apply complex multi-condition formulas, and manage your HR schedules efficiently.

  1. 1. Open Your Data: Launch WPS Office and open your HR schedule or leave tracking spreadsheet.
  2. 2. Access Conditional Formatting: Highlight your target date column and navigate to Home > Conditional Formatting on the top ribbon.
  3. 3. Apply Custom Formulas: Select New Rule, then choose 'Use a formula to determine which cells to format' to input your =AND(...) status logic just like you would in Excel.
Fully compatible with Microsoft Excel (.xlsx) formats and conditional formatting rulesIntuitive interface for managing multiple conditional formatting rules at onceFast processing even with thousands of rows of HR dataFree to use, lightweight, and easy to navigate
microsoft office alternative - wps office

Frequently Asked Questions

Why is my conditional formatting rule highlighting empty cells in red?

Empty cells are often evaluated as zero, which spreadsheets treat as a date far in the past (January 0, 1900). To fix this, add an ISBLANK check to your formula to exclude empty cells, such as: =AND($H2="LOA-Active", $L2<TODAY(), NOT(ISBLANK($L2))).

How do I clear the conditional formatting when the status changes to 'LOA-Returned'?

Because your conditional formatting rules explicitly check if the status column equals 'LOA-Active' or 'LOA-Future', changing the status cell to 'LOA-Returned' will cause those formulas to evaluate to FALSE. The highlight will automatically be removed without needing a separate rule.

Can I apply this conditional formatting to the entire row instead of just the date cell?

Yes. Instead of selecting just the date column, highlight your entire data range (e.g., A2:Z100) before clicking New Rule. Ensure your formula locks the reference to the status and date columns using the $ symbol (e.g., $H2 and $L2). This forces the rule to check those specific columns while applying the color to the whole row.