Question

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

Was it helpful?

Solution

Based on your example, do the following:

  1. Select cell A2:G13 (i.e the dates you want to format)
  2. Now select Format > Conditional Formatting...
  3. In the first drop down menu select Formula Is
  4. In the next textbox enter this formula: =MONTH($A$1)<>MONTH(A2)
  5. Now set the formatting you want for cells that do not match date in cell A1

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)

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top