Conditional Formatting By Month(text)

jhat530

New Member
Joined
Feb 22, 2011
Messages
1
I am trying to use conditional formatting to change the fill. In (A1-A50) I have the birth month of my personal. What I need is for the month to turn Yellow if it is within the next two months from the curent month. If it is the curent month I need it to be red and for all the other months I need it to be green. I tryed using the today function but it is based off of day and year.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Hello jhat530, welcome to MrExcel

If you have the months as text in A1:A50 then try this

Put this formula in E1

=TODAY()

select the range A1:A50 and use these conditions in this order in conditional formatting

condition 1
=A1=TEXT(E$1,"mmmm")
format red

condition 2
=DATEDIF(E$1-DAY(E$1)+1,1&A1&YEAR(E$1)+1,"ym")<3
format yellow

condition 3
=A1<>""
format green

In Excel 2007 or 2010 if you input the conditions in that order they actaully appear in reverse order, so either add those in reverse order or change the order of application afterwards with the up and down arrows
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,710
Members
452,939
Latest member
WCrawford

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