Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default How to sum every 2nd or 3rd row

How to sum every 2nd or 3rd row on the easiest way?


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default How to sum every 2nd or 3rd row

Hi,

Try this

=SUM(IF(MOD(ROW($A$1:$A$100),3)=0,$A$1:$A$100,0))
It's an arry so commit with
Ctrl+Shift+Enter

Change the 3 to a 2 to do every second row

Mike

"Mario" wrote:

How to sum every 2nd or 3rd row on the easiest way?



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default How to sum every 2nd or 3rd row

Summing to any Nth value is quite easy in Excel:
http://www.mcgimpsey.com/excel/formu...meverynth.html

Also, from he
http://www.cpearson.com/excel/excelf.htm
Summing Every Nth Value

You can easily sum (or average) every Nth cell in a column range. For
example, suppose you want to sum every 3rd cell.

Suppose your data is in A1:A20, and N = 3 is in D1. The following array
formula will sum the values in A3, A6, A9, etc.

=SUM(IF(MOD(ROW($A$1:$A$20),$D$1)=0,$A$1:$A$20,0))

If you want to sum the values in A1, A4, A7, etc., use the following array
formula:

=SUM(IF(MOD(ROW($A$1:$A$20)-1,$D$1)=0,$A$1:$A$20,0))

If your data ranges does not begin in row 1, the formulas are slightly more
complicated. Suppose our data is in B3:B22, and N = 3 is in D1. To sum the
values in rows 5, 8, 11, etc, use the following array formula:

=SUM(IF(MOD(ROW($B$3:$B$22)-ROW($B$3)+1,$D$1)=0,$B$3:B$22,0))

If you want to sum the values in rows 3, 6, 9, etc, use the following array
formula:

=SUM(IF(MOD(ROW($B$3:$B$22)-ROW($B$3),$D$1)=0,$B$3:B$22,0))

Download a workbook illustrating these formulas.

Regards,
Ryan--

--
RyGuy


"Mike H" wrote:

Hi,

Try this

=SUM(IF(MOD(ROW($A$1:$A$100),3)=0,$A$1:$A$100,0))
It's an arry so commit with
Ctrl+Shift+Enter

Change the 3 to a 2 to do every second row

Mike

"Mario" wrote:

How to sum every 2nd or 3rd row on the easiest way?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"