# Conditional Highlighting Dates

#### reighzaigne

##### New Member
Hi all,

I'm having trouble trying to come up with a formula for conditional highlighting.

 3 Mar 21 (Date today) Expiration Date 1 Jan 21​ 17 Sep 22​ 1 Jan 21​ 5 Apr 21​ 18 Mar 21​ 1 Jan 21​ 19 Sep 21​ 1 Jan 22​

I want to have 3 rules.

1st rule: (Yellow)
To highlight all dates that fall within the same year.

2nd rule: (Green)
To highlight all dates that are within 60 days from date.

3rd rule: (Red)
To highlight all overdue dates.

I hope someone can help me.

### Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

#### mart37

##### Well-known Member
=Year(B3)=Year(A1)
=A1+60<B3
=B3<A1

#### Fluff

##### MrExcel MVP, Moderator
+Fluff 1.xlsm
AB
103/03/2021
2Expiration Date
301/01/2021
417/09/2022
501/01/2021
605/04/2021
718/03/2021
801/01/2021
919/09/2021
1001/01/2022
Main
Cell Formulas
RangeFormula
A1A1=TODAY()
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B3:B10Expression=AND(B3<\$A\$1+60,B3>\$A\$1)textNO
B3:B10Expression=B3<\$A\$1textNO
B3:B10Expression=YEAR(B3)=YEAR(\$A\$1)textNO

#### reighzaigne

##### New Member
=Year(B3)=Year(A1)
=A1+60<B3
=B3<A1
but is this managed per cell? is there a way for conditional highlighting to be done for the entire column?

#### reighzaigne

##### New Member

+Fluff 1.xlsm
AB
103/03/2021
2Expiration Date
301/01/2021
417/09/2022
501/01/2021
605/04/2021
718/03/2021
801/01/2021
919/09/2021
1001/01/2022
Main
Cell Formulas
RangeFormula
A1A1=TODAY()
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B3:B10Expression=AND(B3<\$A\$1+60,B3>\$A\$1)textNO
B3:B10Expression=B3<\$A\$1textNO
B3:B10Expression=YEAR(B3)=YEAR(\$A\$1)textNO
this looks good. let me try this.

Ok,

#### reighzaigne

##### New Member

+Fluff 1.xlsm
AB
103/03/2021
2Expiration Date
301/01/2021
417/09/2022
501/01/2021
605/04/2021
718/03/2021
801/01/2021
919/09/2021
1001/01/2022
Main
Cell Formulas
RangeFormula
A1A1=TODAY()
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B3:B10Expression=AND(B3<\$A\$1+60,B3>\$A\$1)textNO
B3:B10Expression=B3<\$A\$1textNO
B3:B10Expression=YEAR(B3)=YEAR(\$A\$1)textNO
how? it didn't work for me.

#### Fluff

##### MrExcel MVP, Moderator
In what way didn't it work?

#### reighzaigne

##### New Member
In what way didn't it work?
green and red didnt highlight. yellow showed up but mostly on wrong cells.

#### Fluff

##### MrExcel MVP, Moderator
Do you have the rules in the same order as my post?
Also the B3 needs to reflect the first cell in the applies to range.

Replies
5
Views
178
Replies
4
Views
100
Replies
3
Views
55
Replies
6
Views
105
Replies
9
Views
111

1,130,009
Messages
5,639,530
Members
417,094
Latest member
IsimiKehinde

### 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.

### Which adblocker are you using?

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

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