Search code examples
excelconditional-formattingexcel-2019

Conditional formatting based on month name column in excel 2019


I have Month column and Value column. I want to colour each month vertical range differently so I can see when next month starts (I dont care about colours although it would be best to have at as alternating colour - say white background for odd months and gray for even)

enter image description here


Solution

  • Here are 2 possibilities using custom formula (assumes date is in H6 and the conditional formatting must be set initially in H6):

    alternate color: =ISODD(MONTH($H6)) and select grey background as format.

    line separator: =MONTH($H6)<>MONTH($H7) (or if H6 is text-format: =$H6<>$H7) and select bottom border as format

    The line separator might be preferable if not all month are included (for example if it skips from feb to apr, then background color will be the same)

    Conditional Formatting -> New Rule