#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default CountIF

=SUMPRODUCT(--(D2:D239),--(D2:D23<20))


--
HTH

Bob Phillips

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

"cteacher" <u27106@uwe wrote in message news:66d3c360a0feb@uwe...
I am trying to count a range of cells with multiple conditions. I know
CountIf will not allow two conditions; however, I am trying to count cells
with numbers in cells D2:d23 9 and <20.

Please help!



  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default CountIF

I am trying to count a range of cells with multiple conditions. I know
CountIf will not allow two conditions; however, I am trying to count cells
with numbers in cells D2:d23 9 and <20.

Please help!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default CountIF

Try this...

=countif(d2:d23,and(9,<20))

Using AND should check that both conditions are true before returning true
to the countif.

"cteacher" wrote:

I am trying to count a range of cells with multiple conditions. I know
CountIf will not allow two conditions; however, I am trying to count cells
with numbers in cells D2:d23 9 and <20.

Please help!


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,574
Default CountIF

=COUNTIF(D2:D23<"9")-COUNTIF(D2:D23<"20")

Subtract the count of numbers less than 9 from the count of numbers less
than 20, and you will have the count of all numbers from 9 to 19, inclusive.

Dave
--
Brevity is the soul of wit.


"cteacher" wrote:

I am trying to count a range of cells with multiple conditions. I know
CountIf will not allow two conditions; however, I am trying to count cells
with numbers in cells D2:d23 9 and <20.

Please help!


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default CountIF

Hi Rob,

This only gives me a zero. Looking at my range of numbers, it should be 1.

Rob J wrote:
Try this...

=countif(d2:d23,and(9,<20))

Using AND should check that both conditions are true before returning true
to the countif.

I am trying to count a range of cells with multiple conditions. I know
CountIf will not allow two conditions; however, I am trying to count cells
with numbers in cells D2:d23 9 and <20.

Please help!




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default CountIF

Hi Dave,

When I tried this formula it gives me a -1 and not 1.

Dave F wrote:
=COUNTIF(D2:D23<"9")-COUNTIF(D2:D23<"20")

Subtract the count of numbers less than 9 from the count of numbers less
than 20, and you will have the count of all numbers from 9 to 19, inclusive.

Dave
I am trying to count a range of cells with multiple conditions. I know
CountIf will not allow two conditions; however, I am trying to count cells
with numbers in cells D2:d23 9 and <20.

Please help!


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default CountIF

Here are the range of numbersL

69
13
100
81
63
81
75
25
69
69
81
75
63
81
81
44
69
81
94
69
75
81


Rob J wrote:
Try this...

=countif(d2:d23,and(9,<20))

Using AND should check that both conditions are true before returning true
to the countif.

I am trying to count a range of cells with multiple conditions. I know
CountIf will not allow two conditions; however, I am trying to count cells
with numbers in cells D2:d23 9 and <20.

Please help!


  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,574
Default CountIF

It gave you -1 because I reversed it.

It should be:

=COUNTIF(D2:D23<"20")-COUNTIF(D2:D23<"9")

Sorry about that.

Dave
--
Brevity is the soul of wit.


"cteacher" wrote:

Hi Dave,

When I tried this formula it gives me a -1 and not 1.

Dave F wrote:
=COUNTIF(D2:D23<"9")-COUNTIF(D2:D23<"20")

Subtract the count of numbers less than 9 from the count of numbers less
than 20, and you will have the count of all numbers from 9 to 19, inclusive.

Dave
I am trying to count a range of cells with multiple conditions. I know
CountIf will not allow two conditions; however, I am trying to count cells
with numbers in cells D2:d23 9 and <20.

Please help!



  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default CountIF

Hi Bob.

Thank you!!!!! This it it!!!!!!!!!
Bob Phillips wrote:
=SUMPRODUCT(--(D2:D239),--(D2:D23<20))

I am trying to count a range of cells with multiple conditions. I know
CountIf will not allow two conditions; however, I am trying to count cells
with numbers in cells D2:d23 9 and <20.

Please help!


  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 618
Default CountIF

Dave,

I guess you intended to say
=COUNTIF(D2:D23,"<20")-COUNTIF(D2:D23,"<9")

Note the commas between the arguments for the COUNTIF function, and also the
positioning of the double quotes.
--
David Biddulph

"Dave F" wrote in message
...
It gave you -1 because I reversed it.

It should be:

=COUNTIF(D2:D23<"20")-COUNTIF(D2:D23<"9")

Sorry about that.


"cteacher" wrote:

Hi Dave,

When I tried this formula it gives me a -1 and not 1.

Dave F wrote:
=COUNTIF(D2:D23<"9")-COUNTIF(D2:D23<"20")

Subtract the count of numbers less than 9 from the count of numbers less
than 20, and you will have the count of all numbers from 9 to 19,
inclusive.

Dave
I am trying to count a range of cells with multiple conditions. I know
CountIf will not allow two conditions; however, I am trying to count
cells
with numbers in cells D2:d23 9 and <20.

Please help!







  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,345
Default CountIF

"Dave F" wrote in message
...

=COUNTIF(D2:D23<"20")-COUNTIF(D2:D23<"9")


Dave,

Does that construction work for you?

I need to change it to:

=COUNTIF(D2:D23,"<20")-COUNTIF(D2:D23,"<9")

in XL97 Professional to get it to work.

--
Regards,

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,574
Default CountIF

See David Biddulph's correction. His syntax is correct.
--
Brevity is the soul of wit.


"Sandy Mann" wrote:

"Dave F" wrote in message
...

=COUNTIF(D2:D23<"20")-COUNTIF(D2:D23<"9")


Dave,

Does that construction work for you?

I need to change it to:

=COUNTIF(D2:D23,"<20")-COUNTIF(D2:D23,"<9")

in XL97 Professional to get it to work.

--
Regards,

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk



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
sumproduct vs. countif Coal Miner Excel Discussion (Misc queries) 1 June 15th 06 09:34 PM
Countif Formula /Sort Bug??? orcfodder Excel Discussion (Misc queries) 2 January 12th 06 10:04 AM
COUNTIF or not to COUNTIF on a range in another sheet Ellie Excel Worksheet Functions 4 September 15th 05 10:06 PM
Combining IF and COUNTIF based on two columns maxtrixx Excel Discussion (Misc queries) 5 March 31st 05 06:21 PM
Countif - Countif maswinney Excel Worksheet Functions 3 November 15th 04 11:06 PM


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