View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
roohbir roohbir is offline
external usenet poster
 
Posts: 9
Default COUNTIF criteria

And when I used this =COUNTIF(A1:A13,"="&B1)-COUNTIF(A1:A13,"<="&C1),
it gave 12, where B1 was 41 and C1 was 50. 12 is wrong.
Can you see any reason?
Thanks
Roohbir

Biff wrote:
Try this:

Numbers in the range A2:A14.

=COUNTIF(A2:A14,"=41")-COUNTIF(A2:A14,"50")

Better to use cells to hold the variables:

C2 = 41
D2 = 50

=COUNTIF(A2:A14,"="&C2)-COUNTIF(A2:A14,""&D2)

Biff

"roohbir" wrote in message
ups.com...
I have the following data:
70
80
71
71
66
83
70
77
79
65
62
57
50

I want to use the COUNTIF function to calculate the no. of times
numbers occur in a range. For example how many numbers are between
41-50. The criteria could be something like =41 "to" <=50. But how do
i properly format it.
If COUNTIF cannot be used for this, other suggestions would be welcome.
Actually I want to make a pie-chart or bar-graph chowing this info.
Like how many occurences are within 41-50, 51-60 and so on.
Thanks in adavnce.

Roohbir