Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
iMartyn
 
Posts: n/a
Default How do I Countif for a range of values

I want to check a range of numeric values and count the number that are
between 5 and 10 say. I've tried "=COUNTIF(A1:A30, "5 and <10") but
doesn't seem to work.
Can this be done ?

PS -I'm aware I could count each single value (eg 5, 6, 7, 8, 9, 10) and
then sum separately, but looking for a neater way to do it.

Thanks
iMartyn
  #2   Report Post  
Posted to microsoft.public.excel.misc
bpeltzer
 
Posts: n/a
Default How do I Countif for a range of values

If it's a continuous range so as [5,10), you can get there by counting those
five or greater and subtracting the count of those greater than or equal to
10:
=countif(a1:a30,"=5")-countif(a1:a30,"=10")

"iMartyn" wrote:

I want to check a range of numeric values and count the number that are
between 5 and 10 say. I've tried "=COUNTIF(A1:A30, "5 and <10") but
doesn't seem to work.
Can this be done ?

PS -I'm aware I could count each single value (eg 5, 6, 7, 8, 9, 10) and
then sum separately, but looking for a neater way to do it.

Thanks
iMartyn

  #3   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default How do I Countif for a range of values

One way:
=COUNTIF(A1:A30,"<10")-COUNTIF(A1:A30,"<=5")
and another:
=SUMPRODUCT(--(A1:A305),--(A1:A30<10))

=sumproduct() likes to work with numbers. The -- stuff changes trues to 1's and
falses to 0's.



iMartyn wrote:

I want to check a range of numeric values and count the number that are
between 5 and 10 say. I've tried "=COUNTIF(A1:A30, "5 and <10") but
doesn't seem to work.
Can this be done ?

PS -I'm aware I could count each single value (eg 5, 6, 7, 8, 9, 10) and
then sum separately, but looking for a neater way to do it.

Thanks
iMartyn


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
iMartyn
 
Posts: n/a
Default How do I Countif for a range of values

Elegant ! Thanks very much.

"bpeltzer" wrote:

If it's a continuous range so as [5,10), you can get there by counting those
five or greater and subtracting the count of those greater than or equal to
10:
=countif(a1:a30,"=5")-countif(a1:a30,"=10")

  #5   Report Post  
Posted to microsoft.public.excel.misc
iMartyn
 
Posts: n/a
Default How do I Countif for a range of values

Wow- That's really A-Level. Thanks.

"Dave Peterson" wrote:

One way:
=COUNTIF(A1:A30,"<10")-COUNTIF(A1:A30,"<=5")
and another:
=SUMPRODUCT(--(A1:A305),--(A1:A30<10))

=sumproduct() likes to work with numbers. The -- stuff changes trues to 1's and
falses to 0's.


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
Help PLEASE! Not sure what answer is: Match? Index? Other? baz Excel Worksheet Functions 7 September 3rd 05 03:47 PM
How many values appear more than once in a range? Bruce Norris Excel Worksheet Functions 12 April 5th 05 12:44 PM
Summary of values from a date range Redsmartie Excel Worksheet Functions 4 April 1st 05 06:00 PM
use a date range as criteria in a countif formula mbparks Excel Worksheet Functions 3 January 2nd 05 11:06 PM
Can you average data in 1 column based on a range of values in another? kman24 Excel Worksheet Functions 2 November 17th 04 02:09 PM


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