Conditional Formatting Based on Text and Date Range

welshraz

New Member
Joined
Apr 29, 2016
Messages
39
Office Version
  1. 365
Platform
  1. Windows
I don't know why I can't grasp this, but I want to apply conditional formatting to column J based upon the text in column A, and then the date in column J.

Essentially, if column A does not include the words "Cancelled" or "Completed", I want to highlight the corresponding cell in column J, but the colour then needs to be dependent on how far away that date is from the current day: 10 days or less, 90 days or less, 183 days or less.

<> "Cancelled" <> "Completed" and less than 10 days from the current date - Red
<> "Cancelled" <> "Completed" and less than 10 days from the current date - Amber
<> "Cancelled" <> "Completed" and less than 10 days from the current date - Yellow

Everything else should be left with no fill. Thanks!
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Select column J, and then enter these CF formulas:

For Red:
Excel Formula:
=and(A1<>"Cancelled",A1<>"Completed",today()-J1<10)

For Amber:
Excel Formula:
=and(A1<>"Cancelled",A1<>"Completed",today()-J1>=10,today()-J1<90)

For yellow:
Excel Formula:
=and(A1<>"Cancelled",A1<>"Completed",today()-J1>=90,today()-J1<183)
 
Upvote 0
Solution

Forum statistics

Threads
1,214,947
Messages
6,122,411
Members
449,081
Latest member
JAMES KECULAH

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