PC Review


Reply
Thread Tools Rate Thread

Counting Cells with odd and/or even values

 
 
yungexec
Guest
Posts: n/a
 
      25th Jul 2006

Lets say I have range A1:A5 containing values 1,2,3,4,5 respectively. I
would like to count how many of these cells are odd and place that value
in A6. The same for even numbers as well (in A7).

Any help would be appreciated.


--
yungexec
------------------------------------------------------------------------
yungexec's Profile: http://www.excelforum.com/member.php...o&userid=22593
View this thread: http://www.excelforum.com/showthread...hreadid=564950

 
Reply With Quote
 
 
 
 
Roger Govier
Guest
Posts: n/a
 
      26th Jul 2006
Hi

One way
=SUMPRODUCT(--(MOD(A1:A5,2)=1))
For even numbers, change the 1 in the formula to 0

--
Regards

Roger Govier


"yungexec" <(E-Mail Removed)> wrote
in message news:(E-Mail Removed)...
>
> Lets say I have range A1:A5 containing values 1,2,3,4,5 respectively.
> I
> would like to count how many of these cells are odd and place that
> value
> in A6. The same for even numbers as well (in A7).
>
> Any help would be appreciated.
>
>
> --
> yungexec
> ------------------------------------------------------------------------
> yungexec's Profile:
> http://www.excelforum.com/member.php...o&userid=22593
> View this thread:
> http://www.excelforum.com/showthread...hreadid=564950
>



 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      26th Jul 2006
Shame that ISEVEN doesn't work <g>

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Roger Govier" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi
>
> One way
> =SUMPRODUCT(--(MOD(A1:A5,2)=1))
> For even numbers, change the 1 in the formula to 0
>
> --
> Regards
>
> Roger Govier
>
>
> "yungexec" <(E-Mail Removed)> wrote
> in message news:(E-Mail Removed)...
> >
> > Lets say I have range A1:A5 containing values 1,2,3,4,5 respectively.
> > I
> > would like to count how many of these cells are odd and place that
> > value
> > in A6. The same for even numbers as well (in A7).
> >
> > Any help would be appreciated.
> >
> >
> > --
> > yungexec
> > ------------------------------------------------------------------------
> > yungexec's Profile:
> > http://www.excelforum.com/member.php...o&userid=22593
> > View this thread:
> > http://www.excelforum.com/showthread...hreadid=564950
> >

>
>



 
Reply With Quote
 
Roger Govier
Guest
Posts: n/a
 
      26th Jul 2006
Hi Bob

Yes, I played with that for a while but could not get a solution, so had
to resort to your favourite<g>

--
Regards

Roger Govier


"Bob Phillips" <(E-Mail Removed)> wrote in message
news:Ot%23V3$(E-Mail Removed)...
> Shame that ISEVEN doesn't work <g>
>
> --
> HTH
>
> Bob Phillips
>
> (replace somewhere in email address with gmail if mailing direct)
>
> "Roger Govier" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> Hi
>>
>> One way
>> =SUMPRODUCT(--(MOD(A1:A5,2)=1))
>> For even numbers, change the 1 in the formula to 0
>>
>> --
>> Regards
>>
>> Roger Govier
>>
>>
>> "yungexec" <(E-Mail Removed)>
>> wrote
>> in message
>> news:(E-Mail Removed)...
>> >
>> > Lets say I have range A1:A5 containing values 1,2,3,4,5
>> > respectively.
>> > I
>> > would like to count how many of these cells are odd and place that
>> > value
>> > in A6. The same for even numbers as well (in A7).
>> >
>> > Any help would be appreciated.
>> >
>> >
>> > --
>> > yungexec
>> > ------------------------------------------------------------------------
>> > yungexec's Profile:
>> > http://www.excelforum.com/member.php...o&userid=22593
>> > View this thread:
>> > http://www.excelforum.com/showthread...hreadid=564950
>> >

>>
>>

>
>



 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      26th Jul 2006
Oh it would still be SUMPRODUCT, but if you could do

=SUMPRODUCT(--(ISEVEN(A1:A5)))

that is so much more self-descriptive than using MOD. Unfortunately, the
ISEVEN function seems incapable of processing an array of values, just as
WEEKNUM cannot. Must be something to do with being an ATP function, I wonder
if it works with 2007 (must try it).

You could use

=SUMPRODUCT(--(EVEN(A1:A5)=A1:A5))

but I am not sure that that is any better than MOD

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Roger Govier" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi Bob
>
> Yes, I played with that for a while but could not get a solution, so had
> to resort to your favourite<g>
>
> --
> Regards
>
> Roger Govier
>
>
> "Bob Phillips" <(E-Mail Removed)> wrote in message
> news:Ot%23V3$(E-Mail Removed)...
> > Shame that ISEVEN doesn't work <g>
> >
> > --
> > HTH
> >
> > Bob Phillips
> >
> > (replace somewhere in email address with gmail if mailing direct)
> >
> > "Roger Govier" <(E-Mail Removed)> wrote in message
> > news:%(E-Mail Removed)...
> >> Hi
> >>
> >> One way
> >> =SUMPRODUCT(--(MOD(A1:A5,2)=1))
> >> For even numbers, change the 1 in the formula to 0
> >>
> >> --
> >> Regards
> >>
> >> Roger Govier
> >>
> >>
> >> "yungexec" <(E-Mail Removed)>
> >> wrote
> >> in message
> >> news:(E-Mail Removed)...
> >> >
> >> > Lets say I have range A1:A5 containing values 1,2,3,4,5
> >> > respectively.
> >> > I
> >> > would like to count how many of these cells are odd and place that
> >> > value
> >> > in A6. The same for even numbers as well (in A7).
> >> >
> >> > Any help would be appreciated.
> >> >
> >> >
> >> > --
> >> > yungexec
> >>

> ------------------------------------------------------------------------
> >> > yungexec's Profile:
> >> > http://www.excelforum.com/member.php...o&userid=22593
> >> > View this thread:
> >> > http://www.excelforum.com/showthread...hreadid=564950
> >> >
> >>
> >>

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
counting the cells ignoring zero values awais Microsoft Excel Misc 2 14th Jun 2008 11:37 PM
Re: Counting values in cells Chris2 Microsoft Access Queries 0 16th Nov 2005 08:07 PM
Re: Counting values in cells John Vinson Microsoft Access Queries 0 16th Nov 2005 06:12 PM
Counting cells, similar values =?Utf-8?B?U3RlVw==?= Microsoft Excel Worksheet Functions 7 12th May 2005 07:05 PM
Counting cells between 2 values abxy Microsoft Excel Worksheet Functions 16 7th Feb 2004 05:54 AM


Features
 

Advertising
 

Newsgroups
 


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