aaSumEveryOther j3andc.xls |
---|
|
---|
| A | B | C | D | E | F | G | H | I |
---|
1 | | | | | | | | 0 | Mth |
---|
2 | 4 | 9 | 6 | 5 | 7 | 6 | | 2 | Nth |
---|
3 | | | | | | | | 17 | |
---|
4 | 2 | | | | | | | 13 | |
---|
5 | 1 | | | | | | | | |
---|
6 | 7 | | | | | | | | |
---|
7 | 2 | | | | | | | | |
---|
8 | 4 | | | | | | | | |
---|
9 | 4 | | | | | | | | |
---|
10 | | | | | | | | | |
---|
|
---|
The formula
=SUMPRODUCT((MOD(COLUMN(A2:F2)-CELL("Col",$A2)+H1,H2)=0)*(A2:F2))
sums every Nth value in a horizontal range.
The formula
=SUMPRODUCT((MOD(ROW(A4:A9)-CELL("Row",$A4)+H1,H2)=0)*(A4:A9))
sums every Nth value in a vertical range.
H1-value is the parameter that indicates the position from which to start the summing.
H2-value indicates every Nth value to sum.
When H1 = 0 and H2 = 2, the following values
{4,0,6,0,7,0} in the horizontal range, and
{2;0;7;0;4;0} in the vertical range are summed.
When H1 = 1 and H2 = 2, the following values
{0,9,0,5,0,6} in the horizontal range and
{0;1;0;2;0;4} in the vertical range are summed.
This message was edited by Aladin Akyurek on 2002-09-12 10:00