Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default Odd and even numbers

I need a function that would count how many are odd/even numbers in a row or
column.
eg:
1,3,6,22,35 = this row has 3 odd and 2 even numbers. Is there a function
that can count this for me.

Thanks
RodJ
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Odd and even numbers

For even numbers

=SUMPRODUCT(--(MOD(A1:J1,2)=0),--(ISNUMBER(A1:J1)))


for odd


=SUMPRODUCT(--(MOD(A1:J1,2)=1),--(ISNUMBER(A1:J1)))



--


Regards,


Peo Sjoblom




"RodJ" wrote in message
...
I need a function that would count how many are odd/even numbers in a row
or
column.
eg:
1,3,6,22,35 = this row has 3 odd and 2 even numbers. Is there a function
that can count this for me.

Thanks
RodJ



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default Odd and even numbers


Thanks Peo, i just tried your suggestion and did not work. Do I have to key
in _ _ between brackets?

Thanks heaps
--
RodJ


"Peo Sjoblom" wrote:

For even numbers

=SUMPRODUCT(--(MOD(A1:J1,2)=0),--(ISNUMBER(A1:J1)))


for odd


=SUMPRODUCT(--(MOD(A1:J1,2)=1),--(ISNUMBER(A1:J1)))



--


Regards,


Peo Sjoblom




"RodJ" wrote in message
...
I need a function that would count how many are odd/even numbers in a row
or
column.
eg:
1,3,6,22,35 = this row has 3 odd and 2 even numbers. Is there a function
that can count this for me.

Thanks
RodJ




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default Odd and even numbers

Thanks so much...it did work after i used --.
Wonderful . i really appreciate this....wow...what a great community...
--
RodJ


"Peo Sjoblom" wrote:

For even numbers

=SUMPRODUCT(--(MOD(A1:J1,2)=0),--(ISNUMBER(A1:J1)))


for odd


=SUMPRODUCT(--(MOD(A1:J1,2)=1),--(ISNUMBER(A1:J1)))



--


Regards,


Peo Sjoblom




"RodJ" wrote in message
...
I need a function that would count how many are odd/even numbers in a row
or
column.
eg:
1,3,6,22,35 = this row has 3 odd and 2 even numbers. Is there a function
that can count this for me.

Thanks
RodJ




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Odd and even numbers

=SUMPRODUCT(--(MOD(A1:J1,2)=0),--(ISNUMBER(A1:J1)))

the "--ISNUMBER (A1:J1)" in your formula won't do any good. If one of the
cell contain text value, your formula still returns #VALUE! error.


The *array* formula below ignore any text value

=SUM(IF(ISNUMBER(A1:J1),IF(MOD(A1:J1,2)=1,1)))

*ctrl+shift+enter*, not just enter




"Peo Sjoblom" wrote:

For even numbers

=SUMPRODUCT(--(MOD(A1:J1,2)=0),--(ISNUMBER(A1:J1)))


for odd


=SUMPRODUCT(--(MOD(A1:J1,2)=1),--(ISNUMBER(A1:J1)))



--


Regards,


Peo Sjoblom




"RodJ" wrote in message
...
I need a function that would count how many are odd/even numbers in a row
or
column.
eg:
1,3,6,22,35 = this row has 3 odd and 2 even numbers. Is there a function
that can count this for me.

Thanks
RodJ






  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default Odd and even numbers

Hi,

Try this array formula (Ctrl+Shift+Enter)

=COUNT(IF((MOD(A1:E1,2)<0),A1:E1))

--
Regards,

Ashsih Mathur
Microsoft Excel MVP
www.ashishmathur.com

"RodJ" wrote in message
...
I need a function that would count how many are odd/even numbers in a row
or
column.
eg:
1,3,6,22,35 = this row has 3 odd and 2 even numbers. Is there a function
that can count this for me.

Thanks
RodJ


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 964
Default Odd and even numbers

It will not count blank cells, that was the reason not to avoid text, or
else they will be counted as even (0)

--


Regards,


Peo Sjoblom

"Teethless mama" wrote in message
...
=SUMPRODUCT(--(MOD(A1:J1,2)=0),--(ISNUMBER(A1:J1)))


the "--ISNUMBER (A1:J1)" in your formula won't do any good. If one of the
cell contain text value, your formula still returns #VALUE! error.


The *array* formula below ignore any text value

=SUM(IF(ISNUMBER(A1:J1),IF(MOD(A1:J1,2)=1,1)))

*ctrl+shift+enter*, not just enter




"Peo Sjoblom" wrote:

For even numbers

=SUMPRODUCT(--(MOD(A1:J1,2)=0),--(ISNUMBER(A1:J1)))


for odd


=SUMPRODUCT(--(MOD(A1:J1,2)=1),--(ISNUMBER(A1:J1)))



--


Regards,


Peo Sjoblom




"RodJ" wrote in message
...
I need a function that would count how many are odd/even numbers in a
row
or
column.
eg:
1,3,6,22,35 = this row has 3 odd and 2 even numbers. Is there a
function
that can count this for me.

Thanks
RodJ






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 2002 : Convert Positive Numbers to Negative Numbers ? Mr. Low Excel Discussion (Misc queries) 2 November 6th 06 03:30 PM
change 2000 cells (negative numbers) into positive numbers lisbern Excel Worksheet Functions 2 August 16th 06 05:54 PM
Help! How do you get excel to find the x(changes daily, marked in a cell from another formula) highest numbers in a group of numbers and sum them up? C-Man23 Excel Worksheet Functions 3 January 19th 06 09:52 AM
Help! How do you get excel to find the x(changes daily, marked in a cell from another formula) highest numbers in a group of numbers and sum them up? C-Man23 Excel Worksheet Functions 1 January 9th 06 01:23 PM
to find missing serial numbers in randomly generated numbers B.H. Hadi Excel Worksheet Functions 2 December 1st 05 10:56 PM


All times are GMT +1. The time now is 02:40 AM.

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"