vampirekabir
vampirekabir

Reputation: 99

Sum vertically upto last empty cell on another column repeatedly

Sum vertically upto last empty cell in column A Show sum on the first row where the name resides on column B might contain 0 or more blank cells

What I am willing to achieve is shown below

enter image description here

I have tried Using this formula =IF(B28="",SUM(B29:INDEX(B29:B,MATCH(TRUE,(B29:B=""),0))),"") on column C, I am able to achieve close to similar result but I have to keep single blank cell before every name shown below enter image description here

Spreadsheet link

Upvotes: 0

Views: 231

Answers (1)

MattKing
MattKing

Reputation: 7783

This arrayformula in cell E2 should work:

=Arrayformula(IF(A2:A="",,SUMIF(LOOKUP(ROW(A2:A),FILTER(ROW(A2:A),A2:A<>"")),LOOKUP(ROW(A2:A),FILTER(ROW(A2:A),A2:A<>"")),B2:B)))

The criteria and criterion arrays are made of a lookup that shows the last row number for any given row with a name in it.

Upvotes: 1

Related Questions