PC Review


Reply
Thread Tools Rate Thread

Count with multiple condition

 
 
ou
Guest
Posts: n/a
 
      21st Sep 2004
Hi all
I want to get the count of rows from A1:A20 where the value is greater
than 10 and smaller than 20. I know I could do it by
=countif(A1:A20, "<20") - countif(A1:A20, "<=10")
But I want to do it within one function (nested functions are ok with me
like f(g,h)) like:
=countif(A1:A20, "<20 and >10")
I've tried
=countif(A1:A20, and("<20", ">10"))
and it doesn't work, a little search on the google turns out that
countif can only have one simple condition within it. And it says that I
should use something called array function to do it. I don't really
understand it. Could any of you help me?

Thanks
Ou

P.S
I know I could use a macro to do the job, but I want the simplest one.


 
Reply With Quote
 
 
 
 
RagDyer
Guest
Posts: n/a
 
      21st Sep 2004
Do you mean something like this:

=SUMPRODUCT((A1:A20>10)*(A1:A20<20))
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


"ou" <(E-Mail Removed)> wrote in message
news:jxM3d.3386$kn2.717@trndny07...
Hi all
I want to get the count of rows from A1:A20 where the value is greater
than 10 and smaller than 20. I know I could do it by
=countif(A1:A20, "<20") - countif(A1:A20, "<=10")
But I want to do it within one function (nested functions are ok with me
like f(g,h)) like:
=countif(A1:A20, "<20 and >10")
I've tried
=countif(A1:A20, and("<20", ">10"))
and it doesn't work, a little search on the google turns out that
countif can only have one simple condition within it. And it says that I
should use something called array function to do it. I don't really
understand it. Could any of you help me?

Thanks
Ou

P.S
I know I could use a macro to do the job, but I want the simplest one.


 
Reply With Quote
 
ou
Guest
Posts: n/a
 
      21st Sep 2004
Yes, it works great. Thanks, buddy.
"RagDyer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Do you mean something like this:
>
> =SUMPRODUCT((A1:A20>10)*(A1:A20<20))
> --
>
> HTH,
>
> RD
> ==============================================
> Please keep all correspondence within the Group, so all may benefit!
> ==============================================
>
>
> "ou" <(E-Mail Removed)> wrote in message
> news:jxM3d.3386$kn2.717@trndny07...
> Hi all
> I want to get the count of rows from A1:A20 where the value is greater
> than 10 and smaller than 20. I know I could do it by
> =countif(A1:A20, "<20") - countif(A1:A20, "<=10")
> But I want to do it within one function (nested functions are ok with
> me
> like f(g,h)) like:
> =countif(A1:A20, "<20 and >10")
> I've tried
> =countif(A1:A20, and("<20", ">10"))
> and it doesn't work, a little search on the google turns out that
> countif can only have one simple condition within it. And it says that I
> should use something called array function to do it. I don't really
> understand it. Could any of you help me?
>
> Thanks
> Ou
>
> P.S
> I know I could use a macro to do the job, but I want the simplest one.
>
>



 
Reply With Quote
 
S.Hoitinga
Guest
Posts: n/a
 
      21st Sep 2004
It seems to be working nice, but I don't understand the syntaxis of the
arguments in your sumproduct function.
could you please elaborate. The help file on sumproduct doesnot suggest any
of your brilliant idea.


"RagDyer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Do you mean something like this:
>
> =SUMPRODUCT((A1:A20>10)*(A1:A20<20))
> --
>
> HTH,
>
> RD
> ==============================================
> Please keep all correspondence within the Group, so all may benefit!
> ==============================================
>
>
> "ou" <(E-Mail Removed)> wrote in message
> news:jxM3d.3386$kn2.717@trndny07...
> Hi all
> I want to get the count of rows from A1:A20 where the value is greater
> than 10 and smaller than 20. I know I could do it by
> =countif(A1:A20, "<20") - countif(A1:A20, "<=10")
> But I want to do it within one function (nested functions are ok with
> me
> like f(g,h)) like:
> =countif(A1:A20, "<20 and >10")
> I've tried
> =countif(A1:A20, and("<20", ">10"))
> and it doesn't work, a little search on the google turns out that
> countif can only have one simple condition within it. And it says that I
> should use something called array function to do it. I don't really
> understand it. Could any of you help me?
>
> Thanks
> Ou
>
> P.S
> I know I could use a macro to do the job, but I want the simplest one.
>
>



 
Reply With Quote
 
RagDyer
Guest
Posts: n/a
 
      21st Sep 2004
This has a very good explanation.

http://www.xldynamic.com/source/xld.SUMPRODUCT.html

--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================

"S.Hoitinga" <(E-Mail Removed)> wrote in message
news:4150578d$0$764$(E-Mail Removed)...
It seems to be working nice, but I don't understand the syntaxis of the
arguments in your sumproduct function.
could you please elaborate. The help file on sumproduct doesnot suggest any
of your brilliant idea.


"RagDyer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Do you mean something like this:
>
> =SUMPRODUCT((A1:A20>10)*(A1:A20<20))
> --
>
> HTH,
>
> RD
> ==============================================
> Please keep all correspondence within the Group, so all may benefit!
> ==============================================
>
>
> "ou" <(E-Mail Removed)> wrote in message
> news:jxM3d.3386$kn2.717@trndny07...
> Hi all
> I want to get the count of rows from A1:A20 where the value is greater
> than 10 and smaller than 20. I know I could do it by
> =countif(A1:A20, "<20") - countif(A1:A20, "<=10")
> But I want to do it within one function (nested functions are ok with
> me
> like f(g,h)) like:
> =countif(A1:A20, "<20 and >10")
> I've tried
> =countif(A1:A20, and("<20", ">10"))
> and it doesn't work, a little search on the google turns out that
> countif can only have one simple condition within it. And it says that I
> should use something called array function to do it. I don't really
> understand it. Could any of you help me?
>
> Thanks
> Ou
>
> P.S
> I know I could use a macro to do the job, but I want the simplest one.
>
>



 
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
Multiple Count Condition Jay Microsoft Excel Programming 5 6th Mar 2008 05:20 PM
helps with count under multiple condition =?Utf-8?B?Q2Ft?= Microsoft Excel Misc 1 7th Mar 2007 08:08 PM
Count multiple condition Bob Phillips Microsoft Excel Programming 4 16th Dec 2005 10:11 PM
how to count unique entries with multiple condition =?Utf-8?B?TWljaGFlbA==?= Microsoft Excel Worksheet Functions 6 29th Jun 2005 12:38 PM
Count with multiple condition ou Microsoft Excel Worksheet Functions 6 21st Sep 2004 08:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:18 AM.