Conditional format if year in cell's date is same as current year

touque

Board Regular
Joined
Jan 22, 2009
Messages
107
I have a cell that contains a date in the format 21-Feb-21. I would like it to shade it green if the year in the date is the current year.

I am going to have a second rule where if the year in the cell is before (less than) the current date than shade red.

I believe I can do it simply but bulky by inserting a cell with the TODAY function. Then add two more cells where I extract the year from my cell and TODAY. Then conditional format those in the appropriate cell. But I'm sure there is a less cumbersome way to do it.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
How about
=Year(A2)=YEAR(TODAY())
 
Upvote 0
To red color

Select cells for example A2:A10


=AND(A2<>"",YEAR(A2) < YEAR(TODAY()))
<year(today()))< html=""></year(today()))<>
 
Last edited:
Upvote 0
Fluff, you are the bomb once again!!
Worked like a charm!
I thought I was done with my sheet but I already have further improvements in my head so i may be back tomorrow with more questions!
Thanks Fluff and DanteAmor!
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0
I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,385
Messages
6,119,209
Members
448,874
Latest member
b1step2far

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