I'm trying to create my own gantt chart with Excel as above.
I want to fill color for the cells in the zone of calendar with the help of "Conditional Formatting" but I don't know how to do it for a range of cells.
Here is what I've done:
H13
equals to A13
, O13
equals to H13 + 7
, V13
equals to O13 + 7
...H14
equals to WEEKDAY(H13,2)
, H15
equals to WEEKDAY(H13 + 1,2)
, O14
equals to WEEKDAY(O13,2)
...Now, I'm trying to fill colors for the cells from H15
to N15
based on F15
and G15
. In the above image, the cells from H15
to K115
sould be colorful.
I've googled a lot and I think I should set "Use a Formula to Determine Which Cells to Format" in "Conditional formatting".But I can only set color for some specific cell based on the value of another specific cell, I don't know how to set this for a range of cells.
I've set such a formula =AND($H$13+$H$14:$N$14-1 >= $F$15, $H$13+$H$14:$N$14-1 <= $G$15)
, which is applied to =$H$15:$N$22
, but it doesn't work.
The result of the formula must be a single TRUE
or FALSE
. The Apply to
determine the cells where the formula is applied. With $
define the constant (not changed) row/column values which are not changed in the cell addresses.
=(($H$13+H$14-1)>=$F15)*(($H$13+H$14-1)<=$G15)
To extend for more weeks two alternatives:
=((H$13+H$14-1)>=$F15)*((H$13+H$14-1)<=$G15)
=((OFFSET($H$13,0,INT((COLUMN(H$13)-COLUMN(H$13))/7)*7)+H$14-1)>=$F15)*((OFFSET($H$13,0,INT((COLUMN(H$13)-COLUMN($H$13))/7)*7)+H$14-1)<=$G15)
Set the Apply to
range for the desired size. H15:K115