Conditional Formatting depending on date determined via formula

m27mitchell

New Member
Joined
Mar 29, 2016
Messages
29
Hello, I'm trying to apply conditional formatting to cells that contain a formula that returns a date (deducting days from another cell that contains a date). I want to do the following, but it's not working. I wasn't sure if the reason it's not working may be because the cell that it's formatting contains a formula to return a date, in lieu of an actual date being typed directly in the cell.

- If date in the past - cell is red formula I am using is: =($N6<TODAY()-30)
- If date is within the next 2 weeks - cell is yellow formula I am using is: =AND($N6<TODAY()-14,$N6>TODAY()-31)
- If date is further than 2 weeks out - cell has no color (fill) formula I am using is: =($N6>TODAY()-15)
- If cell is blank - cell has no color (fill) using the "format only cells that contain blanks" option

Any idea on what I'm doing wrong? It's making some of the past dates yellow instead of red, and some red, etc.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
What is the first cell in the applies to range?
 
Upvote 0
The answer to one of your questions is that it doesn’t matter if the cell contains a constant or a formula. I can help with the formulas, but some of your definitions are confusing to me. What does “two weeks out” mean. If that is in the future, then you have a sign error, should be
VBA Code:
=($N6>today() +15

Remember to use the code tags around your code when posting. Just select your code and then click on the button that says <v b a / > on the toolbar.
 
Upvote 0
@m27mitchell
For red use
=AND($N6<>"",$N6<TODAY()-30)
for Yellow use
=AND($N6<>"",$N6<TODAY()+14)
No need to set a condition for blank cells, make sure the the red rule is above the yellow rule in the order of priority
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,936
Members
449,094
Latest member
teemeren

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