Help needed with a formula, please.

  • Thread starter Thread starter Lissa
  • Start date Start date
L

Lissa

How do I write a formula to add the alternating cells in a column? It is a
rather large spreadsheet, so entering each cell individually would be rather
cumbersome and won't fit. Any insight would be greatly appreciated.
 
This formula will sum every other row A2, A4, A6, A8, A10:

=SUMPRODUCT(--(MOD(ROW(A2:A10)-ROW(A2),2)=0),A2:A10)

This formula will sum every other row A3, A5, A7, A9:

=SUMPRODUCT(--(MOD(ROW(A2:A10)-ROW(A2),2)=1),A2:A10)
 
Found this online a while back...not sure where though:

Use these formulas when the data DOES start in row 1.
To start in row N, and sum rows N, 2N, 3N, etc, use
=SUM(IF(MOD(ROW($A$1:$A$20),$D$1)=0,$A$1:$A$20,0))


To start in row 1, and sum rows 1, 1+N, 1+(2N),etc use
=SUM(IF(MOD(ROW($A$1:$A$20)-1,$D$1)=0,$A$1:$A$20,0))

Maybe it came from here:
http://www.ozgrid.com/Excel/sum-every-2nd-nth-cell.htm


Regards,
Ryan--
 

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

Back
Top