How to Apply Multiple Date-Based Conditional Formatting Rules in Excel
Question details
The user needs to format patient-name cells using multiple conditions based on an appointment date and prescription status.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Tracking medical appointments and prescription statuses with automated visual alerts (red, yellow, white) depending on the proximity of the appointment date and if a prescription is received.
- Observed behavior
- Cells need to dynamically change color based on complex criteria involving date differences against the current date and whether certain cells are blank.
Ensure your appointment dates are properly formatted as recognizable Excel dates, and identify the exact columns containing your date values and status indicators before creating the rules.
Using Formula-Based Conditional Formatting with AND and TODAY Functions
Create custom formatting rules using the AND and TODAY functions to evaluate multiple criteria simultaneously, prioritizing them with the 'Stop If True' feature.
You can use the AND function combined with TODAY() to check if multiple conditions are met at the same time, such as whether a date falls within a specific range and another adjacent cell remains blank. Setting up multiple rules requires careful ordering to ensure the correct color is applied when overlapping conditions occur.
Highlight the patient-name cells in column D (or the specific range you want to color format).
Navigate to Home > Conditional Formatting > New Rule > Select 'Use a formula to determine which cells to format'.
Enter the formula for an injection within four days and no prescription: =AND($F13<>"",$O13="",$F13-TODAY()<=4). Click 'Format', choose a red fill color, and click OK.
Repeat the New Rule process and enter the formula for an injection between four and six days away: =AND($F13<>"",$O13="",$F13-TODAY()<=6,$F13-TODAY()>4). Format with a yellow fill color.
Repeat the New Rule process one more time for an injection more than eight days away: =AND($F13<>"",$O13="",$F13-TODAY()>8). Format with a white fill color.
Go to Home > Conditional Formatting > Manage Rules. Ensure the rules are ordered Red at the top, followed by Yellow, and then White. Check the 'Stop If True' box next to each rule to prevent conflicting formats from being applied, then click Apply.

Apply Complex Conditional Formatting Effortlessly in WPS Spreadsheet
WPS Spreadsheet offers powerful, fully compatible conditional formatting features that support advanced formulas like TODAY() and AND(), allowing you to manage complex scheduling data and visual alerts effortlessly.
- 1. Open your data: Launch WPS Spreadsheet and open your appointment tracking workbook.
- 2. Access Conditional Formatting: Highlight your target range, then navigate to 'Home' > 'Conditional Formatting' > 'New Rule'.
- 3. Apply Formulas: Select 'Use a formula to determine which cells to format', enter your AND/TODAY formulas, and customize the background colors.
- 4. Manage Rules: Click 'Manage Rules' to arrange rule priority and enable the 'Stop If True' checkbox to ensure accurate formatting.

Frequently Asked Questions
What does the 'Stop If True' checkbox do in Conditional Formatting?
The 'Stop If True' checkbox tells the spreadsheet software to stop evaluating subsequent formatting rules if the current rule's condition is met. This is critical when you have multiple rules that might overlap or apply to the same cell, ensuring the highest priority rule is the only one applied.
Why aren't my date formulas working correctly in the formatting rule?
Ensure that your date cells are recognized as actual dates (serial numbers) by the software, not as text strings. Additionally, verify that your absolute and relative cell references (using the $ sign) correctly point to the intended columns for evaluation.
Can I apply these date rules to the entire row instead of just one cell?
Yes. Select the entire range of rows before creating the conditional formatting rule. You must make sure to lock the column reference in your formula with a dollar sign (e.g., use $F13 instead of F13) so that every cell in the row evaluates the date from the correct column.
How do I edit a conditional formatting rule I have already created?
Highlight the affected cells, navigate to the Home tab, click Conditional Formatting, and select 'Manage Rules'. Choose the specific rule you want to modify from the list and click 'Edit Rule' to update the formula or change the color formatting.




