ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   SUM odd/even Rows? (https://www.excelbanter.com/excel-worksheet-functions/172407-sum-odd-even-rows.html)

TexJen

SUM odd/even Rows?
 
Is there a way to select a range, and then SUM only the odd # rows in that
range? Or, even # rows?
thnx so much


carlo

SUM odd/even Rows?
 
If you need a formula you could use this:
where A1:A18 is your range
for odd rows:
=SUMPRODUCT((MOD(ROW(A1:A18),2)=1)*(A1:A18))
for even rows
=SUMPRODUCT((MOD(ROW(A1:A18),2)=0)*(A1:A18))

hth
Carlo

On Jan 10, 8:53*am, TexJen wrote:
Is there a way to select a range, and then SUM only the odd # rows in that
range? *Or, even # rows?
thnx so much



Jim Cone

SUM odd/even Rows?
 

This one sums the even numbered rows in Column A - rows 31 to 51...
=SUM(IF(MOD(ROW(A31:A51),2)=0,A31:A51))
It is an array formula and must be entered using Ctrl + Shift + Enter
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"TexJen"
wrote in message
Is there a way to select a range, and then SUM only the odd # rows in that
range? Or, even # rows?
thnx so much


MartinW

SUM odd/even Rows?
 
Hi Jen,

One way is to extract the odd and even cells to helper columns.

For example put the nimbers 1 to 20 in A1:A20
Then put this in B1
=INDEX(A:A,ROW()*2-1)
And this in C1
=INDEX(A:A,ROW()*2)

Grab the fill handle and drag both formulae down to Row 10.
That will leave all the odd numbers in column B
and all the even numbers in column C

HTH
Martin


"TexJen" wrote in message
...
Is there a way to select a range, and then SUM only the odd # rows in that
range? Or, even # rows?
thnx so much




Gord Dibben

SUM odd/even Rows?
 
Even =SUMPRODUCT((A1:B10)*(MOD(ROW(A1:B10),2)=0))


Odd =SUMPRODUCT((A1:B10)*(MOD(ROW(A1:B10),2)<0))


Gord Dibben MS Excel MVP

On Wed, 9 Jan 2008 15:53:43 -0800, TexJen
wrote:

Is there a way to select a range, and then SUM only the odd # rows in that
range? Or, even # rows?
thnx so much



Alan Beban[_2_]

SUM odd/even Rows?
 
TexJen wrote:
Is there a way to select a range, and then SUM only the odd # rows in that
range? Or, even # rows?
thnx so much

If the functions in the freely downloaded file at
http://home.pacbell.net/beban are available to your workbook

Odd--=SUM(ArrayAlternates(A1:D11))

Even--=SUM(ArrayAlternates(A1:D11,False))

Alan Beban


All times are GMT +1. The time now is 10:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com