Conditional Formula for highlighting dates greater than 7 days

SomethngWicked

Board Regular
Joined
Feb 18, 2015
Messages
79
Hi Excel Wizards,

I've been trying to figure out a solution for the following problem. In one column, I have a series of dates that stretch back between 1 day to several years. I'm trying to come up with a formula that would highlight the cell as being red if the time is > 14 days, yellow if greater than 8-13 days, and green if it's <7 days.

So for example, cell A1 has a value of 12/17/2018 1:50:04 PM. This should be highlighted red. Cell A2 has a value of 1/9/2019 2:00:11 PM and should be green. Cell A3 has a value of 1/1/2019 1:47:21 PM and should be yellow.

Thanks in advance!
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
I think this should work, this assumes your dates AND times are proper Excel dates and times

Select the range first, e.g. A1:A1000

Conditional Formatting
New Rule
Use a formula to determine...

=AND(A1>=TODAY(),A1<=TODAY()+13)
format as yellow

=AND(A1>=TODAY(),A1<=TODAY()+7)
format as green

=AND(A1>=TODAY(),A1>TODAY()+14)
format as red


UPDATE: Just understand your requirements, go with Scott's answer, mine is wrong.
 
Last edited:
Upvote 0
You will need a rule for each possible color

for red
Code:
=NOW()-A1>14

for green
Code:
=AND(NOW()-A1>7,NOW()-A1<14)

for Yellow
Code:
=NOW()-A1<=7
 
Upvote 0
You will need a rule for each possible color

for red
Code:
=NOW()-A1>14

for green
Code:
=AND(NOW()-A1>7,NOW()-A1<14)

for Yellow
Code:
=NOW()-A1<=7

I think this will work. I had to change the formula out for green and yellow though. :) Is it possible to exclude this formula from blank cells? Thank you for your help!
 
Upvote 0
Just for information, you can do it with one rule if you use icon sets. In this case, select your range, click Conditional Formatting > Icon Sets > and choose any 3-icon set. Then click Conditional Formatting > Manage Rules > select your rule > Edit Rule. Now go to the top box that says Type: change it to Formula, and in the Value box put =TODAY()-7. On the next row down change the type to Formula, and in the Value box put: =TODAY()-14. Click OK.
 
Upvote 0

Forum statistics

Threads
1,215,291
Messages
6,124,093
Members
449,142
Latest member
championbowler

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