ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I get the sum of only odd/even numbered cells in a column? (https://www.excelbanter.com/excel-discussion-misc-queries/15878-how-do-i-get-sum-only-odd-even-numbered-cells-column.html)

Steve E

How do I get the sum of only odd/even numbered cells in a column?
 
I need help with the formula to sum up only the odd or even numbers in a
column. I appreciate any help that you can provide.

Thanks,
Steve

Peo Sjoblom

One way,

even

=SUMPRODUCT(--(MOD(A1:A10,2)=0),A1:A10)

odd

=SUMPRODUCT(--(MOD(A1:A10,2)=1),A1:A10)


--

Regards,

Peo Sjoblom

"Steve E" <Steve wrote in message
...
I need help with the formula to sum up only the odd or even numbers in a
column. I appreciate any help that you can provide.

Thanks,
Steve




Bob Phillips

=SUM(IF(MOD(A1:A100,2)=0,A1:A100))

for even numbers, and

=SUM(IF(MOD(A1:A100,2)=1,A1:A100))

for odd numbers.

These are array formulae, so commit with Ctrl-Shift-Enter.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Steve E" <Steve wrote in message
...
I need help with the formula to sum up only the odd or even numbers in a
column. I appreciate any help that you can provide.

Thanks,
Steve




Ron Rosenfeld

On Thu, 3 Mar 2005 06:37:09 -0800, "Steve E" <Steve
wrote:

I need help with the formula to sum up only the odd or even numbers in a
column. I appreciate any help that you can provide.

Thanks,
Steve


Odd: =SUMPRODUCT(MOD(A1:A25,2)*A1:A25)
Even: =SUM(A1:A25,-SUMPRODUCT(MOD(A1:A25,2)*A1:A25))


--ron


All times are GMT +1. The time now is 12:14 PM.

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