sum every nth cell in a row

  • Thread starter BNT1 via OfficeKB.com
  • Start date
B

BNT1 via OfficeKB.com

Sorry Posted in wrong group earlier

Hi

I am trying to adapt Bob Phillips formula

=SUMPRODUCT((B2:B32)*(MOD(ROW(B2:B32)-ROW(B2),n)+1=m))

I have cells, e5,e6,e7,e8,e9,e10,e11,e12,e13,e14,e15, etc
I want to sum, e5,e9,e13 etc
I will need to adapt this in another cell to add, e6,e10,e14 etc and
therefore need to understand the N + M value

I have entered the formula below in cell c5, but get 0. Have entered as
array formula
{=SUMPRODUCT((E5:AY5)*(MOD(ROW(E5:AY5)-ROW(B2),4)+1=F5))}

What am I doing wrong

Help appriciated

Brian
 
T

T. Valko

need to understand the N + M value

N = divisor used in the MOD function
M = mod

For example:

Using cell E5:

MOD(ROW(E5),n)=m

MOD(ROW(E5),4)=1
I want to sum, e5,e9,e13 etc
=SUMPRODUCT(--(MOD(ROW(E5:E100),4)=1),E5:E100)

I will need to adapt this in another cell to add, e6,e10,e14 etc

=SUMPRODUCT(--(MOD(ROW(E5:E100),4)=2),E5:E100)
 
B

BNT1 via OfficeKB.com

Keep getting #Value! error

copied and pasted in c5, and entered with shift+ctl+ent
=SUMPRODUCT(--(MOD(ROW(E5:E100),4)=1),E5:E100)

Any ieas?



T. Valko said:
need to understand the N + M value

N = divisor used in the MOD function
M = mod

For example:

Using cell E5:

MOD(ROW(E5),n)=m

MOD(ROW(E5),4)=1
I want to sum, e5,e9,e13 etc
=SUMPRODUCT(--(MOD(ROW(E5:E100),4)=1),E5:E100)

I will need to adapt this in another cell to add, e6,e10,e14 etc
=SUMPRODUCT(--(MOD(ROW(E5:E100),4)=2),E5:E100)

Sorry Posted in wrong group earlier
[quoted text clipped - 18 lines]
 
T

T. Valko

entered with shift+ctl+ent

Doesn't need to be array entered but that won't cause an error. Just ENTER
will work.
Keep getting #Value! error

Are there any #VALUE! errors already in the range?

Here's a small sample file that demonstrates this.

xSumNth.xls 14kb

http://cjoint.com/?dvxr6QVxsY


--
Biff
Microsoft Excel MVP


BNT1 via OfficeKB.com said:
Keep getting #Value! error

copied and pasted in c5, and entered with shift+ctl+ent
=SUMPRODUCT(--(MOD(ROW(E5:E100),4)=1),E5:E100)

Any ieas?



T. Valko said:
need to understand the N + M value

N = divisor used in the MOD function
M = mod

For example:

Using cell E5:

MOD(ROW(E5),n)=m

MOD(ROW(E5),4)=1
I want to sum, e5,e9,e13 etc
=SUMPRODUCT(--(MOD(ROW(E5:E100),4)=1),E5:E100)

I will need to adapt this in another cell to add, e6,e10,e14 etc
=SUMPRODUCT(--(MOD(ROW(E5:E100),4)=2),E5:E100)

Sorry Posted in wrong group earlier
[quoted text clipped - 18 lines]
 
B

BNT1 via OfficeKB.com

thanks T.Valko

After looking at the link, realised, I gave you wrong info, my range was in a
one row, different columns

changed "row" to "column" and presto worked !

Thanks for your patients

brian

Thanks fo
T. Valko said:
entered with shift+ctl+ent

Doesn't need to be array entered but that won't cause an error. Just ENTER
will work.
Keep getting #Value! error

Are there any #VALUE! errors already in the range?

Here's a small sample file that demonstrates this.

xSumNth.xls 14kb

http://cjoint.com/?dvxr6QVxsY
Keep getting #Value! error
[quoted text clipped - 30 lines]
 
T

T. Valko

Glad you got it straightened out. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


BNT1 via OfficeKB.com said:
thanks T.Valko

After looking at the link, realised, I gave you wrong info, my range was
in a
one row, different columns

changed "row" to "column" and presto worked !

Thanks for your patients

brian

Thanks fo
T. Valko said:
entered with shift+ctl+ent

Doesn't need to be array entered but that won't cause an error. Just ENTER
will work.
Keep getting #Value! error

Are there any #VALUE! errors already in the range?

Here's a small sample file that demonstrates this.

xSumNth.xls 14kb

http://cjoint.com/?dvxr6QVxsY
Keep getting #Value! error
[quoted text clipped - 30 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

sum every nth cell in a row 1
Payment calculation 1
Sum of every nth cell in a column 3
Formula 6
Tricky Formulas 14
Tricky Formula 2
Concatenate Macro 6
Formula not working 1

Top