Using conditional formatting with Dates

Newbienew

Active Member
Joined
Mar 17, 2017
Messages
395
Office Version
  1. 2016
Platform
  1. Windows
I am trying to use conditional formatting with dates in the form of 30 days out 60 days out and 90 days<style>table { }tr { }col { }br { }td { padding-top: 1px; padding-right: 1px; padding-left: 1px; color: black; font-size: 11pt; font-weight: 400; font-style: normal; text-decoration: none; font-family: Calibri,sans-serif; vertical-align: bottom; border: medium none; white-space: nowrap; }.xl63 { font-weight: 700; border: 0.5pt solid windowtext; }.xl64 { border: 0.5pt solid windowtext; }</style> [TABLE="width: 344"]
<colgroup><col style="mso-width-source:userset;mso-width-alt:2694; width:120pt" width="160" span="2"> <col style="mso-width-source:userset;mso-width-alt:2344;width:104pt" width="139"> </colgroup><tbody>[TR]
[TD="class: xl63, width: 160"]30 days[/TD]
[TD="class: xl63, width: 160"]60 days[/TD]
[TD="class: xl63, width: 139"]90 days [/TD]
[/TR]
[TR]
[TD="class: xl64"]=D2+30[/TD]
[TD="class: xl64"]=E2+30[/TD]
[TD="class: xl64"]=F2+30[/TD]
[/TR]
[TR]
[TD="class: xl64"]=IF(E2<=NOW(),"true","")[/TD]
[TD="class: xl64"]=IF(F2<=NOW(),"true","")[/TD]
[TD="class: xl64"]=IF(G2<=NOW(),"true","")
[/TD]
[/TR]
</tbody>[/TABLE]

So when I enter the date in D2, E2 which is in green 30 days give me 30 days out from that date. If D2 is blank the conditional formatting remains.
<style>table { }tr { }col { }br { }td { padding-top: 1px; padding-right: 1px; padding-left: 1px; color: black; font-size: 11pt; font-weight: 400; font-style: normal; text-decoration: none; font-family: Calibri,sans-serif; vertical-align: bottom; border: medium none; white-space: nowrap; }.xl65 { font-weight: 700; border: 0.5pt solid windowtext; }.xl66 { border: 0.5pt solid windowtext; }</style> [TABLE="width: 172"]
<colgroup><col style="mso-width-source:userset;mso-width-alt:2694; width:60pt" width="80" span="2"> <col style="mso-width-source:userset;mso-width-alt:2344;width:52pt" width="70"> </colgroup><tbody>[TR]
[TD="class: xl65, width: 80"]30 days[/TD]
[TD="class: xl65, width: 80"]60 days[/TD]
[TD="class: xl65, width: 70"]90 days
[/TD]
[/TR]
[TR]
[TD="class: xl66, align: right"]1/30/1900[/TD]
[TD="class: xl66, align: right"]2/29/1900[/TD]
[TD="class: xl66, align: right"]3/30/1900
[/TD]
[/TR]
[TR]
[TD="class: xl66"]true[/TD]
[TD="class: xl66"]true[/TD]
[TD="class: xl66"]true
[/TD]
[/TR]
</tbody>[/TABLE]
This is what I get when E2 is left blank, I would greatly appreciate the help
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
because a blank cell is read as 0 - which is also seen as a date 1900 - thats why you get the formatting as it is lower

use an AND ( E2<>"" , E2 <= now() )

E2 <> ""
is testing if the cell E2 is NOT <> blank

Now() also uses the time off the system
if you are just using a Date and NOT the time use
Today()

you can add the formula direct to conditional formatting and do not need to use a IF with true and false
conditional formatting will only apply if the formula is true
 
Upvote 0

Forum statistics

Threads
1,223,897
Messages
6,175,271
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