OK then, lets see if we can bring some enlightenment
=SUM(OFFSET($C$3,(ROW()-ROW($C$2))*7,,7))
The SUM bit should be obvious, and will sum whatever range you pass to it via any valid method, and in this case we are simply passing it a a 7 cell range that increments by 7 cells every time you move down one, Q is, how?
This all lies in the OFFSET function, which has the following syntax:-
=OFFSET(reference,rows,cols,[height],[width])
The reference argument is the starting point for the function, and the last two arguments are optional. The way this works, using just one of the arguments (row) as an example is as follows:-
In say cell A1, if you put the following formula
=OFFSET($B$1,1,0)
this is the same as saying, start at B1 and Offset 1 row down, which gives you B2
=OFFSET($B$1,1,0) = B2
=OFFSET($B$1,2,0) = B3
=OFFSET($B$1,3,0) = B4
=OFFSET($B$1,4,0) = B5
=OFFSET($B$1,5,0) = B6
or if I were to use the column argument,
=OFFSET($B$1,0,1) = C1
=OFFSET($B$1,0,2) = D1
=OFFSET($B$1,0,3) = E4
or with both
=OFFSET($B$1,1,1) = C2
=OFFSET($B$1,1,2) = D2
=OFFSET($B$1,3,2) = D4
Now, if you then factor in other functions such as ROW(), that will increment by 1 each time you move down a row, watch what happens
In A1 =ROW() = 1
In A2 =ROW() = 2
In A3 =ROW() = 3
so, therefore, if I put *7 on the end
In A1 =ROW()*7 = 1*7 = 7
In A2 =ROW()*7 = 2*7 = 14
In A3 =ROW()*7 = 3*7 = 21 etc (See the pattern)
This means that by tying those two together, eg:-
In A1 =OFFSET($B$1,((ROW()-1)*7),0) = OFFSET($B$1,0,0) = B1
In A2 =OFFSET($B$1,((ROW()-1)*7),0) = OFFSET($B$1,7,0) = B8
In A3 =OFFSET($B$1,((ROW()-1)*7),0) = OFFSET($B$1,14,0) = B15
This shows you how you can increment by 7 each time, or whatever number you come up with, BUT, what you now need is a way to tell it that the range you want is 7 cells from and including those cells B1, B8, B15 etc, so that this range can then be passed to the SUM function.
Well, remember those optional arguments I mentioned in OFFSET, one of them was height (the last one), and if you specify this as say 7, then it will create a 7 cell range from and including whatever cell the other OFFSET arguments have gotten you to, eg the B1, B8, B15. So, taking the 3 formula lines from above here:-
In A1 =OFFSET($B$1,((ROW()-1)*7),0,,7) = OFFSET($B$1,0,0) = B1:B7
In A2 =OFFSET($B$1,((ROW()-1)*7),0,,7) = OFFSET($B$1,7,0) = B8:B14
In A3 =OFFSET($B$1,((ROW()-1)*7),0,,7) = OFFSET($B$1,14,0) = B15:B21
Note the two commas together ,, as this simply menas that you are not using the width argument, but if you don't put in the comma, it will assume that the 7 is a width argument and not a height argument.
All these get passed to the SUM function and you then end up with in this case:-
=SUM(B1:B7)
=SUM(B8:B14)
=SUM(B15:B21) etc
Hopefully this helps you somewhat
Regards
Ken.......................
----------------------------------------------------------------------------
![[peace] [peace] [peace]](/data/assets/smilies/peace.gif)
It's easier to beg forgiveness than ask permission
----------------------------------------------------------------------------