Home > Software design >  Highlight Month Columns based on dates in Google Sheet
Highlight Month Columns based on dates in Google Sheet

Time:01-13

I would highlight, in Google Sheet, the columns of months based on dates in col AA:
dd/mm/yyyy (start date) - dd/mm/yyyy (end date).

Example:
Col AA ---> 25/05/2022 - 06/09/2022
The columns that must be highlighted: from May to September.

CodePudding user response:

The best way is to change headers of column and put inside the first day of each month. Then apply a format as MMMM.

Conditionnal formatting formula:

=and(C$1>=EOMONTH($A2;-1) 1;C$1<=EOMONTH($B2;0))

if you can't change headers, the formula will be:

=and(MATCH(proper(text(index(split($AA2;" - ");1);"MMMM"));{"Gennaio";"Febbraio";"Marzo";"Aprile";"Maggio";"Giugno";"Luglio";"Agosto";"Settembre";"Ottobre";"Novembre";"Dicembre"};0)<=MATCH(B$1;{"Gennaio";"Febbraio";"Marzo";"Aprile";"Maggio";"Giugno";"Luglio";"Agosto";"Settembre";"Ottobre";"Novembre";"Dicembre"};0);MATCH(proper(text(iferror(index(split($AA2;" - ");2);"31/12/2022"*1);"MMMM"));{"Gennaio";"Febbraio";"Marzo";"Aprile";"Maggio";"Giugno";"Luglio";"Agosto";"Settembre";"Ottobre";"Novembre";"Dicembre"};0)>=MATCH(B$1;{"Gennaio";"Febbraio";"Marzo";"Aprile";"Maggio";"Giugno";"Luglio";"Agosto";"Settembre";"Ottobre";"Novembre";"Dicembre"};0))
  •  Tags:  
  • Related