Conditional formatting using IF And

android1

Board Regular
Joined
Feb 12, 2016
Messages
69
Need to apply conditional formatting to a cell containing a date

e.g L6 = (08/06/2019)



Criteria are:



If L6 is 2 months or less away from todays date & If M6 is Blank then


L6 should be filled red.


If L6 is 1 month or less away from todays date & If M6 is Blank then


L6 should be filled blue



(Is it possible to have the cell flash rather than fill a colour. Ok if not possible)

Sample Sheet -> https://www.dropbox.com/s/808vub4morxq7gt/Date Renewal.xlsx?dl=0

 
Last edited:

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
First, you should review your criteria because they can give the same result. When L6 is 2 months or less away from today it's also 1 month or less away from today.
Second, in your example you give L6=08/06/2019. Is 2019 a typo?
Third, L6 can be in the future or in the past from todays date. Better is to view if L6 is > (bigger) or < (smaller) then today
Fourth, flashing cells can only be achieved with VBA.

That said, here's a an example to get you going. Directions in column F.

Row\Col
A​
B​
C​
D​
E​
F​
G​
1​
Between 60 and 30 daysBetween 29 and 0 daysDateToday
2​
FALSE​
FALSE​
1-6-2018​
7-8-2018​
1. Select C2:C14
3​
FALSE​
FALSE​
7-6-2018​
7-8-2018​
2. Conditional formatting
4​
TRUE
FALSE​
8-6-2018
7-8-2018​
3. New Rule
5​
TRUE
FALSE​
5-7-2018
7-8-2018​
4. Use a formula to determine which cells to format
6​
TRUE
FALSE​
6-7-2018
7-8-2018​
5. Type the first formula
7​
TRUE
FALSE​
7-7-2018
7-8-2018​
6. Redo 1 till 5 for thr second formula
8​
TRUE
FALSE​
8-7-2018
7-8-2018​
=AND(D2-C2<=29;D2-C2>=0)BLUE
9​
FALSE​
TRUE
9-7-2018
7-8-2018​
=AND(D2-C2<=60;D2-C2>=30)RED
10​
FALSE​
TRUE
10-7-2018
7-8-2018​
11​
FALSE​
TRUE
11-7-2018
7-8-2018​
12​
FALSE​
TRUE
12-7-2018
7-8-2018​
13​
FALSE​
TRUE
13-7-2018
7-8-2018​
14​
FALSE​
TRUE
14-7-2018
7-8-2018​
 
Upvote 0
Hi,

You need to be more specific.

Do you mean if L6 is 2 months or less away from today "In the Past", or "In the Future"?

Also, the dates in your sample are inconsistent in format, some are mm/dd/yyyy, and some are dd/mm/yyyy
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,547
Members
449,089
Latest member
davidcom

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