Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
mike1448
 
Posts: n/a
Default adding odd numbers

How can I add only the odd numbers in a column of numbers?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max
 
Posts: n/a
Default adding odd numbers

One way, assuming the col of numbers is within A1:A100

Try in say, B1:
=SUMPRODUCT(--(MOD(A1:A100,2)=1),A1:A100)

and for summing the even numbers,
just switch the "MOD(...)=1", to "MOD(...)=0", i.e.:
=SUMPRODUCT(--(MOD(A1:A100,2)=0),A1:A100)
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"mike1448" wrote in message
...
How can I add only the odd numbers in a column of numbers



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
B. R.Ramachandran
 
Posts: n/a
Default adding odd numbers

Hi,

If your data are in the range A2:A101, in some other cell (e.g., B2) enter
the following formula: it will add all the odd numbers in the column.

=SUMPRODUCT((A2:A101)*(MOD(A2:A101,2)=1))

To add only even numbers, change the '1' at the end of the formula to '0')

Regards,
B. R. Ramachandran


"mike1448" wrote:

How can I add only the odd numbers in a column of numbers?

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
Adding numbers in a single cell chefcasey Excel Worksheet Functions 1 September 14th 05 06:51 AM
Adding new numbers as I type without duplicates from Sheet1,ColumnA to Sheet2,ColumnA Master Excel Worksheet Functions 2 July 12th 05 05:03 PM
Match Last Occurrence of two numbers and Count to Previous Occurence Sam via OfficeKB.com Excel Worksheet Functions 33 April 4th 05 02:17 PM
Excel Adding duplicated numbers together JJ Joobler Excel Discussion (Misc queries) 1 January 7th 05 01:24 AM
Re What is the formula for adding multiple numbers in a cell merlin_au Excel Discussion (Misc queries) 2 January 4th 05 11:50 AM


All times are GMT +1. The time now is 10:38 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"