How to Fix Excel Conditional Formatting When Comparing Dates in Two Columns
Question details
The user needs to correct conditional formatting rules that produce inconsistent results when comparing dates between two columns.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Applying a conditional formatting rule to compare dates in two columns to highlight specific cells, but the formatting shifts or highlights the wrong rows.
- Observed behavior
- The conditional formatting shifts out of sync or produces inaccurate highlighting because the formula's starting row reference does not match the first row of the applied range.
Verify the exact range of cells your conditional formatting is applied to (e.g., T2:T1000) and take note of your header rows, as this determines the correct row number for your formula.
Align the Formula Reference with the Specific Applies-to Range
Fix inconsistent formatting by ensuring your formula references the exact starting row of your selected range, excluding headers.
Conditional formatting evaluates formulas relative to the active cell in the selected range. If your 'Applies to' range starts at row 2, your formula must also reference row 2. Mismatched references cause the formatting to shift out of sync.
Navigate to the Home tab on the Excel ribbon, click on 'Conditional Formatting', and select 'Manage Rules'.
Locate the problematic rule in the list, select it, and click 'Delete Rule' to prevent any conflicts with the new setup.
Click 'New Rule' and choose 'Use a formula to determine which cells to format'.
If your 'Applies to' range is =$T$2:$T$1000, enter the formula =$T2>$M2. Ensure the row number (2) strictly matches the starting row of your range.
Click 'Format' to choose your desired highlight style, click 'OK', and then hit 'Apply' in the Rules Manager.

Apply Conditional Formatting to an Entire Column
Adjust the formula to reference row 1 if you prefer to apply the conditional formatting to the entire column including future entries.
Compare Dates with Conditional Formatting in WPS Spreadsheet
WPS Spreadsheet offers a robust and intuitive Conditional Formatting tool fully compatible with Microsoft Excel formulas. You can seamlessly compare columns, highlight data variations, and apply custom rules without hassle.
- 1. Open your document: Launch WPS Spreadsheet and open the file containing the dates you want to compare.
- 2. Highlight the data range: Select the specific cells or column you wish to format (e.g., T2:T1000).
- 3. Access Conditional Formatting: Navigate to the Home tab and click on the 'Conditional Formatting' icon.
- 4. Apply the formula: Select 'New Rule', choose the formula option, input your correctly referenced formula (like =$T2>$M2), set the format style, and click OK.

Frequently Asked Questions
Why does my conditional formatting highlight the wrong rows?
This usually happens when the row number in your conditional formatting formula does not match the first row in your 'Applies to' range. For example, if your range starts at T2 but the formula uses T1, the formatting will shift down by one row.
How do I prevent my header row from being highlighted by conditional formatting?
Start your 'Applies to' range from row 2 (e.g., T2:T1000) and ensure your formula also references row 2 (e.g., =$T2>$M2). If you apply it to the whole column, you can add an AND condition to exclude row 1, such as =AND(ROW()>1, T1>M1).
Can I use conditional formatting to compare dates across different worksheets?
Yes, but you must use the INDIRECT function or named ranges in your formula to reference cells on another worksheet, as standard conditional formatting does not natively support direct cross-sheet references without these workarounds.




