Conditional formatting - Automatic banding of months

sharshra

Active Member
Joined
Mar 20, 2013
Messages
360
Office Version
  1. 365
In a timelines table, I have the weekly dates. Based on the date entered in the first cell, remaining weeks are calculated. Now, I want to do conditional format to have alternating bands for different months. At present, it is done manually. Month banding becomes incorrect if the dates are changed.

As shown in the sample table below, weeks in Sep to Dec 2024 are banded with today´s date as initial date. If the initial date is changed, the monthly bands should adjust automatically.

 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
you could use something
=ISODD(MONTH(A$1))


Cell Formulas
RangeFormula
B1:N1B1=A1+7
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:N11Expression=ISODD(MONTH(A$1))textYES



for 2007, 2010 , 2013 , 2016 , 2019 or 365 Subscription excel version
Conditional Formatting

Highlight applicable range >>
A1:Z100 - Change, reduce or extend the rows to meet your data range of rows

Home Tab >> Styles >> Conditional Formatting
New Rule >> Use a formula to determine which cells to format
Edit the Rule Description: Format values where this formula is true:
=ISODD(MONTH(A$1))

Format [Number, Font, Border, Fill]
choose the format you would like to apply when the condition is true
OK >> OK
 
Upvote 1
Solution
Hi @sharshra,
If you can use another row (let's say row #2), I suggest you use a formula like this: in J2, put =1, and then in K2..Y2: =if(month(k3)=month(j3),k2,-k2)
Then you can use a formula in your conditional format: if cell values is 1 then set background as white, otherwise, grey
 
Upvote 0

Forum statistics

Threads
1,221,821
Messages
6,162,157
Members
451,750
Latest member
pnkundalia

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