Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Akhilesh Dalia
 
Posts: n/a
Default Help in Excel 2000

How do I get sum of all odd or even numbers from the series (1, 2, 3, .....,
n) by using SUMIF function and MOD function or any other function?
  #2   Report Post  
Max
 
Posts: n/a
Default

One way:

Assuming series / numbers is in row1

Sum of Even:
=SUMPRODUCT(--(MOD((1:1),2)=0),1:1)

Sum of Odd:
=SUMPRODUCT(--(MOD((1:1),2)=1),1:1)

If there could be possibly some "text" numbers in row1,
try:

Sum of Even:
=SUMPRODUCT(--(MOD((1:1),2)=0),--(1:1))

Sum of Odd:
=SUMPRODUCT(--(MOD((1:1),2)=1),--(1:1))
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
Akhilesh Dalia <Akhilesh wrote in message
...
How do I get sum of all odd or even numbers from the series (1, 2, 3,

......,
n) by using SUMIF function and MOD function or any other function?



  #3   Report Post  
Max
 
Posts: n/a
Default

Note that all the suggested formulas are reading the entire row1
hence these formulas have to be entered in cells *other*
than those in row1, otherwise you'll get circular ref errors !

If you need to enter the formulas in the same row,
use range references (e.g.: A1:F1), i.e. something like:

In G1: =SUMPRODUCT(--(MOD((A1:F1),2)=0),A1:F1)
Then G1 can be copied down to evaluate similarly for other
series in A2:F2, A3:F3, etc

--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----


  #4   Report Post  
Akhilesh Dalia
 
Posts: n/a
Default

Thank you very much!!

I got my job done. You provided a great help.

Thanks once again!!

Regards

Akhilesh Dalia

"Max" wrote:

Note that all the suggested formulas are reading the entire row1
hence these formulas have to be entered in cells *other*
than those in row1, otherwise you'll get circular ref errors !

If you need to enter the formulas in the same row,
use range references (e.g.: A1:F1), i.e. something like:

In G1: =SUMPRODUCT(--(MOD((A1:F1),2)=0),A1:F1)
Then G1 can be copied down to evaluate similarly for other
series in A2:F2, A3:F3, etc

--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----



  #5   Report Post  
Max
 
Posts: n/a
Default

Glad to hear it helped !
Thanks for the feedback ..
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
Akhilesh Dalia <Akhilesh wrote in message
...
Thank you very much!!

I got my job done. You provided a great help.

Thanks once again!!

Regards

Akhilesh Dalia





  #6   Report Post  
Harlan Grove
 
Posts: n/a
Default

"Max" wrote...
One way:

Assuming series / numbers is in row1

Sum of Even:
=SUMPRODUCT(--(MOD((1:1),2)=0),1:1)

Sum of Odd:
=SUMPRODUCT(--(MOD((1:1),2)=1),1:1)

....

The original question looked like it could have been solved using standard
variations on Gauss's formula.

Sum of odd numbers from 1 to N = ((N + 1)/2)^2 for N odd.

Sum of even numbers from 2 to N = N * (N + 2)/4 for N even.


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
Excel 2002 and 2000 co-install. Control Which Starts ? cnuk Excel Discussion (Misc queries) 2 January 17th 05 08:07 PM
Excel 2000 file when opened in Excel 2003 generates errors? Doug Excel Discussion (Misc queries) 13 December 25th 04 10:20 PM
pivotcell object to excel 2000 Kellyc Excel Discussion (Misc queries) 0 December 1st 04 03:45 PM
Statistical Excel Function Question within Excel 2000... Drew H Excel Worksheet Functions 3 October 31st 04 06:55 PM


All times are GMT +1. The time now is 08:23 PM.

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

About Us

"It's about Microsoft Excel"