Reputation: 1394
I am creating a work calendar and I want it to Grey out the Days of the week that are NOT part of the currently displayed month. I have the First Day of the Month Displayed in Cell A1
How can I make the Cell Monday in Cell B3 and the Cell in B4 to have a grey background?
I know this is simple but I cannot figure it out.
Thanks
Upvotes: 0
Views: 5401
Reputation: 12487
Based on your example, do the following:
=MONTH($A$1)<>MONTH(A2)
This formula works by simply checking the month number of the date.
Note also that the formula check for inequality of dates i.e. if date is not in same month as that in cell A1 then format a different color.
If you also want to add a format for dates that do match then simply add another condition in the conditional formatting box and use =MONTH($A$1)=MONTH(A2)
Upvotes: 1
Reputation: 6822
Home > Styles > Conditional Formatting > Highlight Cells Rules > A Date Occuring... > This Month
Obviously if you go this route, you would make the whole calendar year gray and then set the conditional formatting to make the current month white.
Upvotes: 1