Excel - Sum cells down until identifier

Solution 1:

In cell B2, enter formula :

=SUM(B3:B$18)-SUMIF(A3:A$18,"<>",B3:B$18)*2

Edited

or ,

=SUM(OFFSET(B3,,,MATCH(1,FREQUENCY(1,N(A3:A$18<>"")),0)-1))

then, copied and pasted to B6, B15, and B17

enter image description here