Conditional Formatting a Row Based on a Date Range

Chris Waller

Board Regular
Joined
Jan 18, 2009
Messages
183
Office Version
  1. 365
Platform
  1. Windows
I am trying to apply conditional formatting that will highlight a row from column A to O if the following conditions are met.

=$K3<= today () this should highlight the row with grey shading
This is to highlight any row where the date has passed

=And($K3-today()+20,$K3-today()<=26) which should highlight the row in orange
This is to highlight any date between 20 days and 26 days in the future

=And($K3-today()+27,$K3-today()<=33) which should highlight the row in yellow
This is to highlight any date between 27 days and 33 days in the future

Column K contains the date.

I have tried altering the order of the three conditions and no matter what I do there are rows that are highlighted that shouldn’t be. The grey shading appears to work and I think the yellow shading appears to work, but the orange shading doesn't appear to work as there are rows highlighted that shouldn't be.

Thanks in advance
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Perhaps
=And($K3>=today()+20,$K3-today()<=26)
=And($K3>=today()+27,$K3-today()<=33)
 
Last edited:
Upvote 0
Thanks for the formula it really helped me sort out the problem, however, I did have to tweak the second part of each formula i.e.

$K3-today()<=26) to $K3<=today()+26
$K3-today()<=33) to $K3<=today()+33

I was only able to do this because you supplied the information for the start of the formula.

Thanks once again. I did manage to get it to work. Brilliant.
 
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,274
Members
452,628
Latest member
dd2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top