Conditional Formatting using dates

mattbird

Active Member
Joined
Oct 15, 2013
Messages
305
Office Version
  1. 2016
Hi,I am trying conditional formal a cell with a date working of another date.in Cell E6 I have entered a start date and in Cell H6 a review date. I would like cell H6 to show green if within 6 weeks of the start, orange if between 6-12 weeks and red if over 12 weeks.I am currently using Excel 2016.Great full for any helpMatt
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Select H6

Conditional Formatting
New Rule
Use a formula to determine...
3 rules, in this order

=AND(H6>0,H6<=C6+84)
format as orange

=AND(H6>0,H6<=C6+42)
format as green

=AND(H6>0,H6>C6+84)
format as red
 
Upvote 0
The order of the rules actually won't matter if you define/narrow the ranges a little better, so that there is not overlap between then (i.e. between 42 and 84, etc).
Which date is the larger date, the one in E6 or the one in H6?
Are they both always populated?
 
Upvote 0
[Table="width:, class:head"][tr=bgcolor:#E0E0F0][th] [/th][th]
E
[/th][th]
F
[/th][th]
G
[/th][th]
H
[/th][th]
I
[/th][/tr]
[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
5
[/td][td]Start date[/td][td][/td][td][/td][td]Review date[/td][td][/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
6
[/td][td]
1/1/2018​
[/td][td][/td][td][/td][td=bgcolor:#92D050]
1/30/2018​
[/td][td][/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
7
[/td][td]
12/3/2018​
[/td][td][/td][td][/td][td=bgcolor:#FFC000]
2/2/2019​
[/td][td][/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
8
[/td][td]
2/14/2018​
[/td][td][/td][td][/td][td=bgcolor:#FF0000]
6/9/2018​
[/td][td][/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
9
[/td][td]
3/19/2018​
[/td][td][/td][td][/td][td=bgcolor:#FFC000]
5/30/2018​
[/td][td][/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
10
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]
[/table]
[Table="width:, class:grid"][tr][td]Sheet: Sheet34[/td][/tr][/table]

Green CF formula applied to cell range H6:H9:
=(H6-E6)<=42

Orange CF formula applied to cell range H6:H9:
=((H6-E6)>42)*((H6-E6)<=84)

Red CF formula applied to cell range H6:H9:
=(H6-E6)>84
 
Upvote 0
Hi, Thanks for every ones help.

Special K99: When I entered the dates it would not show green only orange or red ie 7 May 18 to 18 Jun 18 should stay green, 19 Jun 18 to 30 Jul 18 orange and 31 Jul onwards red, But your formula was orange from the 7 May 18 - 30 Jul 18 and then turned red on the 31 Jul 18 onwards.

Oscar Cronquist: Your formulas worked just fine.

Joe4: In answer to your question the date in Cell H6 is larger and both should be populated.

Thanks again for your help and fast response.

Matt
 
Upvote 0

Forum statistics

Threads
1,224,747
Messages
6,180,714
Members
452,995
Latest member
isldboy

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