I am trying to achieve a formula that will only sum rows which have a count value of 1 and ignore 0 valued rows.
However I only want the sum of the previous 12 rows with a 1 count value (Column C).
For example:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]A1[/TD]
[TD]100[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A2[/TD]
[TD]110
[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A3[/TD]
[TD]120[/TD]
[TD]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A4[/TD]
[TD]130[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A5[/TD]
[TD]140[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A6[/TD]
[TD]150[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A7[/TD]
[TD]160[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A8[/TD]
[TD]170[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A9[/TD]
[TD]180[/TD]
[TD]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A10[/TD]
[TD]190[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A11[/TD]
[TD]200[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A12[/TD]
[TD]210[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A13[/TD]
[TD]220[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A14[/TD]
[TD]230[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A15[/TD]
[TD]240[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A16[/TD]
[TD]250[/TD]
[TD]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A17[/TD]
[TD]260[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A18[/TD]
[TD]270[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A19[/TD]
[TD]280[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A20[/TD]
[TD]290[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I would like cell D20 to sum B20+B19+B18+B17+B15+B14+B13+B12+B11+B10+B8+B7 excluding B16 & B9 as they have a zero value in Column C but to stop at B7 as I only want to sum the total of 12 cells.
There will be no regular pattern for the values in column C other than they will be 1 or 0.
Many thanks in advance
However I only want the sum of the previous 12 rows with a 1 count value (Column C).
For example:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]A1[/TD]
[TD]100[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A2[/TD]
[TD]110
[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A3[/TD]
[TD]120[/TD]
[TD]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A4[/TD]
[TD]130[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A5[/TD]
[TD]140[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A6[/TD]
[TD]150[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A7[/TD]
[TD]160[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A8[/TD]
[TD]170[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A9[/TD]
[TD]180[/TD]
[TD]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A10[/TD]
[TD]190[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A11[/TD]
[TD]200[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A12[/TD]
[TD]210[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A13[/TD]
[TD]220[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A14[/TD]
[TD]230[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A15[/TD]
[TD]240[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A16[/TD]
[TD]250[/TD]
[TD]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A17[/TD]
[TD]260[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A18[/TD]
[TD]270[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A19[/TD]
[TD]280[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A20[/TD]
[TD]290[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I would like cell D20 to sum B20+B19+B18+B17+B15+B14+B13+B12+B11+B10+B8+B7 excluding B16 & B9 as they have a zero value in Column C but to stop at B7 as I only want to sum the total of 12 cells.
There will be no regular pattern for the values in column C other than they will be 1 or 0.
Many thanks in advance