Conditional format based on date

bhavikpatel

New Member
Joined
May 14, 2014
Messages
30
Hi all,

I have the following table:

ABCDEFGH
1Month #MonthRenewalItem2017201820192020
21Jan01-JanItem 1100150200250
33Mar01-MarItem 2200250300350
45May01-MayItem 3300350400450
57Jul01-JulItem 4400450500550
68Aug11-AugItem 5500550600650
78Aug11-AugItem 6600650700750
88Aug11-AugItem 7700750800850
98Aug11-AugItem 8800850900950
108Aug11-AugItem 990095010001050
119Sep03-SepItem 101000105011001150
129Sep26-SepItem 111100115012001250
1310Oct01-OctItem 121200125013001350
1410Oct01-OctItem 131300135014001450
1511Nov01-NovItem 141400145015001550
1611Nov01-NovItem 151500155016001650
1711Nov30-NovItem 161600165017001750
1812Dec01-DecItem 171700175018001850

<colgroup><col><col><col><col><col><col><col span="3"></colgroup><tbody>
</tbody>


I want to conditional format so the amounts in columns E onwards are highlighted if they are up for renewal within the next 12 months from today.

I basically want it to be so as we stand today (9th November 2017) - the current highlighted cells would be E17 and E18 as well as F2-F16. The rest would remain as they are. Then by 2nd December F2-F18 would be highlighted, before 1 Jan when it would change again for Item1.

Is there a relatively painless conditional formatting formula I could input to achieve this? (the year columns go on for a while so would like to avoid formatting each cell)

Thanks in advance for the help!
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Select the cells you want to conditional format (E2:H18 in your sample)

in conditional formatting use this formula. Select your formatting and click OK
Code:
=AND(DATE(E$1,MONTH($C2),DAY($C2))<DATE(YEAR(TODAY())+1,MONTH(TODAY()),DAY(TODAY())),TODAY()<DATE(E$1,MONTH($C2),DAY($C2)))
 
Upvote 0
<date(year(today())+1,month(today()),day(today())),today()<date(e$1,month($c2),day($c2)))[ code][="" quote]
Select the cells you want to conditional format (E2:H18 in your sample)

in conditional formatting use this formula. Select your formatting and click OK
Code:
=AND(DATE(E$1,MONTH($C2),DAY($C2))<date(year(today())+1,month(today()),day(today())),today()<date(e$1,month($c2),day($c2)))[ code][="" quote]
 ]</date(year(today())+1,month(today()),day(today())),today()<date(e$1,month($c2),day($c2)))[>

Hi Scott, 

Thanks for the reply!

Unfortunately, the above formula makes all calls E2:H18 highlighted. I only wanted the cells in the next 12 months to be highlighted. Any ideas?

Thanks</date(year(today())+1,month(today()),day(today())),today()<date(e$1,month($c2),day($c2)))[>
 
Last edited:
Upvote 0
Forum cut off the rest of the formula try
Code:
=AND(DATE(E$1,MONTH($C2),DAY($C2))>TODAY(),DATE(YEAR(TODAY())+1,MONTH(TODAY()),DAY(TODAY()))>=DATE(E$1,MONTH($C2),DAY($C2)))
 
Upvote 0

Forum statistics

Threads
1,215,320
Messages
6,124,238
Members
449,149
Latest member
mwdbActuary

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