Consecutive Cells from column

Hello, I am looking for an equation that will give me the total of consecutive cells…

Basically I am looking for the formula in the Count Column (G) to return the same manual entered totals in (F). Column (F) will be deleted if I can get the formula to work…

I currently have =SUBTOTAL(9,E2:E$10000)*2-SUM(E2:E$10000) but that is only returning “0”. Any ideas? Thanks in advance!

Since the function SUBTOTAL is only useful when applied to filtered ranges I will not comment on the formula posted in the OQ.

To get the number of cells of a contiguous sections filled in a column by formulas, the MATCH function should be the means of choice. However, matching is always done top down. Therefore it is much more effcient to return the result to the topmost row of any section than to the bottommost.
This statement applies mainly if the result is expected to be returned by a single formula.

Even more efficient and much more flexible are solutions using a helper column. In addition you can avoid this way formulas using ranges reaching far down and needing a value for the last row.

You may study this attached example.

Thank you very much, Im new to Libre Office and found the SUBTOTAL function and was trying to force it to work. Thanks again, your right a Helper column will be much more useful. Thanks

BTW: Who did force you to use LibreOffice?
See also: Amor fati - Wikipedia