Reputation: 967
I was able to make the following gantt chart with the simple formula below, however i am having trouble adapting the formula to handle the case when the project lasts 3 months - you can see the example on row 4.
What i did was simply put a date Jul 1 2020, Aug 1, 2020, etc in row 1 and then in each row, i check the start and end against row 1 to see if its equal... if so, set the cell to true, and use conditional formatting to color it.
Now how would you check if the the row 1 date is in the range between start and end, and then set to true?
Thank you!
=ifna(
ifs(
AND(month($F2)=month(J$1), year($F2)=year(J$1)), true,
AND(month($G2)=month(J$1), year($G2)=year(J$1)), true
)
,"")
Upvotes: 0
Views: 967
Reputation: 912
=IF(AND(
C1 >= $A2,
C1 <= $B2
),TRUE," ")
Test it here if you want: link to spreadsheet
Upvotes: 1
Reputation: 34315
Just test if the month in the first row falls between the dates in the first two columns. So the custom formula would be:
=and(H$1>=$F2,H$1<=$G2)
Upvotes: 0