Forum Discussion
Conditional Formatting - red/green based on deadline date
- Oct 25, 2023
Select I4:I10.
I4 should be the active cell in the selection.
On the Home tab of the ribbon, click Conditional Formatting > New Rule...
Select 'Use a formula to determine which cells to format'.
Enter the formula=AND(I4<>"",I4<=$H$4)
Click Format...
Activate the Fill tab.
Select green as highlight color.
Click OK, then click OK again.Repeat these steps, but with the formula
=I4>$H$4
and red as fill color.
Select I4:I10.
I4 should be the active cell in the selection.
On the Home tab of the ribbon, click Conditional Formatting > New Rule...
Select 'Use a formula to determine which cells to format'.
Enter the formula
=AND(I4<>"",I4<=$H$4)
Click Format...
Activate the Fill tab.
Select green as highlight color.
Click OK, then click OK again.
Repeat these steps, but with the formula
=I4>$H$4
and red as fill color.
- AJacko02Dec 09, 2025Copper Contributor
Thank you for this! If I wanted to apply this to a column of data, so each row is its own check (eg
Task 1 - date due in cell M2, date received N2
Task 2 - date due in cell M3, date received N3 etc etc)
how would I do this?
- Lobo360Dec 10, 2025Brass Contributor
If you apply the formula of the solution without the $ signs then it won’t be fixed to “H4” and instead it varies in accordance.
So adapting the given solution to the cell references in your examples:Green =AND(N2<>””,N2<=M2)
Red =N2>M2
Applies to =$N$2:$N$10
So although in conditional formatting it is only M2 and N2 that is specifically referenced, excel should know when applying to a range to adjust accordingly.
- emsplitOct 25, 2023Copper ContributorThank you SO very much, Hans! That was something I had not yet tried, and it worked perfectly. Appreciate it, thanks again, and hope you have a great day,