Using conditional formatting with Dates

Newbienew

Active Member
Joined
Mar 17, 2017
Messages
376
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>
30 days60 days90 days
=D2+30=E2+30=F2+30
=IF(E2<=NOW(),"true","")=IF(F2<=NOW(),"true","")=IF(G2<=NOW(),"true","")

<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>
</tbody>

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>
30 days60 days90 days
1/30/19002/29/19003/30/1900
truetruetrue

<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>
</tbody>
This is what I get when E2 is left blank, I would greatly appreciate the help
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
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,214,920
Messages
6,122,279
Members
449,075
Latest member
staticfluids

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