Barry,
Elegant solution! Mine is so similar I am somewhat reluctant to post it because I don't want to take away from what is a solid approach. There are just a couple of points that I think might be interesting to O.
(I have, as I usually do, separated the data table from the summary or control table. I call my two tables for this example Data and Control.)
The two points are:
1. In a conditional sum or count function, the equal sign can be omitted, as it is the default comparison operator. (But, it doesn't hurt to include it.)
2. It is not necessary to use the absolute column notation in either the comparison or value reference argument of the conditional sum or count function.
In the screen shot that follows, the formula in Column A of the table Data is:
=MOD(ROW()-Control :: $2:$2-1, Control :: $1:$1)
and, the forumula for the SUM is:
=SUMIF(Data :: A, 0, Data :: B)
Jerry