Attached Table in A2 - E10 lists the Planned and Actual Start and Finish Dates for four Activities.
GANTT BY MONTH in rows 29 - 37 works perfectly, using SUM PRODUCT to establish how many days each Calendar month are covered by the Date span:
E.g. C30 (Planned Activity 1 (3rd - 10th Jan) shows 8 days in January:
=IF(SUMPRODUCT(--(MONTH(ROW(INDIRECT($C4 & ":" & IF($D4="",TODAY(),$D4))))=MONTH(C$29)))>0,SUMPRODUCT(--(MONTH(ROW(INDIRECT($C4 & ":" & IF($D4="",TODAY(),$D4))))=MONTH(C$29))),"")
First challenge is failing to adapt the Formula so it establishes how many days each Calendar WEEK are covered by the Date Span:
E.g. C16 (Planned Activity 1 (3rd - 10th Jan) in week 1 SHOULD show 5 days in week 1:
=if(SUMPRODUCT(--(WEEKNUM(ROW(INDIRECT($C3 & ":" & IF($D3="",TODAY(),$D3))))=WEEKNUM(C$15)))>0,SUMPRODUCT(--(WEEKNUM(ROW(INDIRECT($C3 & ":" & IF($D3="",TODAY(),$D3))))=WEEKNUM(C$15)))>0,"")
Unfortunately, as shown on row 16, it generates weeks 1 - 7 as 5s, then weeks 8 - 14 as 3s (SHOULD be 5 in week 1 and 3 in week 2).
Second challenge is the need to adapt the formula so the User can SUMPRODUCT working days (assuming Mon - Fri) as well as Calendar days.
All solutions, alternatives and recommendations welcome as ever.
Ochimus
Bookmarks