Conditional Formatting with an if satement

mhassan

New Member
Joined
Mar 2, 2012
Messages
4
Good afternoon. I need help with a formula. I need to show a red font if the date has gone past 10 days and yellow font if the date is past 7 days
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
use conditional format rules with formulas
2 rules needed

=AND(A2<>"",A2<TODAY()-10)
and
=AND(A2<>"",A2<TODAY()-7)

Order the RED formula first in the list and STOP if TRUE

i have added column C and D so you can see the formula working, not required for conditional formatting , just FYI

you can choose just to format the font colour, i also formatted the fill as well for display here purposes

Book1
ABCD
110 days7day
22/27/21TRUETRUE
32/28/21TRUETRUE
43/1/21TRUETRUE
53/2/21TRUETRUE
63/3/21TRUETRUE
73/4/21TRUETRUE
83/5/21TRUETRUE
93/6/21TRUETRUE
103/7/21TRUETRUE
113/8/21TRUETRUE
123/9/21TRUETRUE
133/10/21TRUETRUE
143/11/21TRUETRUE
153/12/21TRUETRUE
163/13/21TRUETRUE
173/14/21TRUETRUE
183/15/21FALSETRUE
193/16/21FALSETRUE
203/17/21FALSETRUE
213/18/21FALSEFALSE
223/19/21FALSEFALSE
233/20/21FALSEFALSE
243/21/21FALSEFALSE
253/22/21FALSEFALSE
263/23/21FALSEFALSE
273/24/21FALSEFALSE
283/25/21FALSEFALSE
293/26/21
Sheet1
Cell Formulas
RangeFormula
C2:C28C2=A2<TODAY()-10
D2:D28D2=A2<TODAY()-7
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A29Expression=AND(A2<>"",A2<TODAY()-10)textYES
A2:A29Expression=AND(A2<>"",A2<TODAY()-7)textYES
 
Upvote 0
I am having trouble with the conditional formatting. I can't get the dates to change font color to reflect 10 days red font and 7 days yellow font.
 
Upvote 0
did you setup the conditional formatting
And are you sure the column with dates are real dates ?
try adding XL2BB addin - see signature / menu item and post a sample here OR post on a share like onedrive or dropbox

to add a condtional format
select the column - lets say the dates are in column A
for 2007, 2010 , 2013 , 2016 , 2019 or 365 Subscription excel version
Conditional Formatting

Highlight applicable range >>

A2:A1000


Home Tab >> Styles >> Conditional Formatting
New Rule >> Use a formula to determine which cells to format
Edit the Rule Description: Format values where this formula is true:


=AND(A2<>"",A2<TODAY()-7)


Format [Number, Font, Border, Fill] USE Font YELLOW
STOP IF TRUE
choose the format you would like to apply when the condition is true
OK >> OK

ADD another Rule
New Rule >> Use a formula to determine which cells to format
Edit the Rule Description: Format values where this formula is true:


=AND(A2<>"",A2<TODAY()-10)


Format [Number, Font, Border, Fill] USE Font RED
STOP IF TRUE
choose the format you would like to apply when the condition is true
OK >> OK

Now make sure the RED RULE is at the top of the rules, you can change the order
 
Upvote 0
did you setup the conditional formatting
And are you sure the column with dates are real dates ?
try adding XL2BB addin - see signature / menu item and post a sample here OR post on a share like onedrive or dropbox

to add a condtional format
select the column - lets say the dates are in column A
for 2007, 2010 , 2013 , 2016 , 2019 or 365 Subscription excel version
Conditional Formatting

Highlight applicable range >>

A2:A1000



Home Tab >> Styles >> Conditional Formatting
New Rule >> Use a formula to determine which cells to format
Edit the Rule Description: Format values where this formula is true:


=AND(A2<>"",A2<TODAY()-7)


Format [Number, Font, Border, Fill] USE Font YELLOW
STOP IF TRUE
choose the format you would like to apply when the condition is true
OK >> OK

ADD another Rule
New Rule >> Use a formula to determine which cells to format
Edit the Rule Description: Format values where this formula is true:


=AND(A2<>"",A2<TODAY()-10)


Format [Number, Font, Border, Fill] USE Font RED
STOP IF TRUE
choose the format you would like to apply when the condition is true
OK >> OK

Now make sure the RED RULE is at the top of the rules, you can change the order
Thank you so much!! It worked :)
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,731
Members
448,987
Latest member
marion_davis

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