Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 60
Default Counting items in a list

Say if have a list of numbers in cells A1:A5

12
99
9
3
60

I would like to count the number of values that are between 1 and 10
exclusive using a formula something like this:

{=SUM(IF(AND(A1:A51,A1:A5<100),1,0))}

However I always get 0 for the answer. Any ideas?

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default Counting items in a list

Try something like this:

With your posted example data in A1: A5

This formula returns the count of items between 1 and 10, exclusive
B1: =COUNTIF(A1:A5,"1")-COUNTIF(A1:A5,"=10")

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Matt" wrote:

Say if have a list of numbers in cells A1:A5

12
99
9
3
60

I would like to count the number of values that are between 1 and 10
exclusive using a formula something like this:

{=SUM(IF(AND(A1:A51,A1:A5<100),1,0))}

However I always get 0 for the answer. Any ideas?


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 60
Default Counting items in a list

That would work. However, I would like to use a formula syntax that is
similar to the original. I don't understand why that particular
formula is not working.
Thanks!

Ron Coderre wrote:
Try something like this:

With your posted example data in A1: A5

This formula returns the count of items between 1 and 10, exclusive
B1: =COUNTIF(A1:A5,"1")-COUNTIF(A1:A5,"=10")

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Matt" wrote:

Say if have a list of numbers in cells A1:A5

12
99
9
3
60

I would like to count the number of values that are between 1 and 10
exclusive using a formula something like this:

{=SUM(IF(AND(A1:A51,A1:A5<100),1,0))}

However I always get 0 for the answer. Any ideas?



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Counting items in a list

Ron's suggestion is the best solution for this specific situation.

But, if you want something similar to what you tried (array entered):

=SUM(IF(A1:A51,IF(A1:A5<100,1)))

The reason yours didn't work as expected is because the AND function
evaluates as a single condition. So, it would only return either a 1 or a 0.
If *every cell* in the range met the condition then the result would be 1.
If *any* cell in the range did not meet the condition then the result would
be 0.

Another way to do this (normally entered):

=SUMPRODUCT(--(A1:A51),--(A1:A5<100))

Biff

"Matt" wrote in message
ups.com...
That would work. However, I would like to use a formula syntax that is
similar to the original. I don't understand why that particular
formula is not working.
Thanks!

Ron Coderre wrote:
Try something like this:

With your posted example data in A1: A5

This formula returns the count of items between 1 and 10, exclusive
B1: =COUNTIF(A1:A5,"1")-COUNTIF(A1:A5,"=10")

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Matt" wrote:

Say if have a list of numbers in cells A1:A5

12
99
9
3
60

I would like to count the number of values that are between 1 and 10
exclusive using a formula something like this:

{=SUM(IF(AND(A1:A51,A1:A5<100),1,0))}

However I always get 0 for the answer. Any ideas?





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 694
Default Counting items in a list

Try the following as an array formula:

=SUM((A1:A51)*(A1:A5<1))
--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Matt" wrote:

That would work. However, I would like to use a formula syntax that is
similar to the original. I don't understand why that particular
formula is not working.
Thanks!

Ron Coderre wrote:
Try something like this:

With your posted example data in A1: A5

This formula returns the count of items between 1 and 10, exclusive
B1: =COUNTIF(A1:A5,"1")-COUNTIF(A1:A5,"=10")

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Matt" wrote:

Say if have a list of numbers in cells A1:A5

12
99
9
3
60

I would like to count the number of values that are between 1 and 10
exclusive using a formula something like this:

{=SUM(IF(AND(A1:A51,A1:A5<100),1,0))}

However I always get 0 for the answer. Any ideas?






  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 694
Default Counting items in a list

The last two digits appear to have gone astray:

=SUM((A1:A51)*(A1:A5<100))

That is more like it.
--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Martin Fishlock" wrote:

Try the following as an array formula:

=SUM((A1:A51)*(A1:A5<1))
--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Matt" wrote:

That would work. However, I would like to use a formula syntax that is
similar to the original. I don't understand why that particular
formula is not working.
Thanks!

Ron Coderre wrote:
Try something like this:

With your posted example data in A1: A5

This formula returns the count of items between 1 and 10, exclusive
B1: =COUNTIF(A1:A5,"1")-COUNTIF(A1:A5,"=10")

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Matt" wrote:

Say if have a list of numbers in cells A1:A5

12
99
9
3
60

I would like to count the number of values that are between 1 and 10
exclusive using a formula something like this:

{=SUM(IF(AND(A1:A51,A1:A5<100),1,0))}

However I always get 0 for the answer. Any ideas?




  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Counting items in a list

=SUM(IF((A1:A51)*(A1:A5<10),1))

ctrl+shift+enter, not just enter


"Matt" wrote:

Say if have a list of numbers in cells A1:A5

12
99
9
3
60

I would like to count the number of values that are between 1 and 10
exclusive using a formula something like this:

{=SUM(IF(AND(A1:A51,A1:A5<100),1,0))}

However I always get 0 for the answer. Any ideas?


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
Drop-Down List Choice Affects Multiple Cells? Patrick R Excel Worksheet Functions 5 November 24th 06 12:33 AM
how do i create a drop down list of items from a different file Profnutbutter Excel Worksheet Functions 3 March 31st 06 08:00 PM
named range, data validation: list non-selected items, and new added items KR Excel Discussion (Misc queries) 1 June 24th 05 05:21 AM
Indexing items from a pick list Pank Mehta Excel Discussion (Misc queries) 1 February 3rd 05 09:29 AM
Counting Repeated text or duplicates in a list Repeatdude Excel Discussion (Misc queries) 5 November 26th 04 07:10 PM


All times are GMT +1. The time now is 05:30 PM.

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"