I have a project that is of variable length, denoted in D2 as 39 Months. In cell H1 I have the following - =EDATE($B$2, SEQUENCE(1, $D$2, 0)) which automatically calculaes the months for the duration of the project. I'd like to create a function that will automatically add the values in H3 and H4 then I3 and I4 etc. So in H5 I have =SUM(H3:H4), is there anyway I can paste a function into H5 that will sum each of the columns for the duration of the project?
CodePudding user response:
=BYCOL(INDEX($1:$1048576,{3;4},SEQUENCE(1,D2,8)),LAMBDA(x,SUM(x)))
It indexes al rows 3 and 4 from column H and the next n columns, where n is the value in D2. Then sums the indexed range column-by-column.