# Partial sums of a column of values

I have a column of values like this:
0`
1
3
0
0
12
45
56
0
How do I compute the subtotals of contiguous nonzero numbers?

edit retag close merge delete

Sort by » oldest newest most voted

See this example.

===Edit1: Enhanced Example===
Here it is.

more

Thanks! I understand that the A2:A1001 is assumed to be the maximum run the data can have?

( 2019-02-23 02:43:42 +0200 )edit

It's not just the maximum run (of non-zero values), but the maximum range of any values.
You were right - basically. The range of 1000 rows moves down with the starting row. That's not a really satisfying solution. (It seems I had a kind of blackout.)
To expand the range without too much decrease in efficiency can be achieved using helper formulae that only need to look at two rows instead of many. The partial sums can then be taken from a "Pivot Table".
See the enhanced example.

( 2019-02-23 02:53:40 +0200 )edit

Wow, you already did what I have to accomplished next. Thank you very much!

( 2019-02-23 03:36:40 +0200 )edit