COUNTIF for range of numbers

G

Guest

I hav got the following numbers:
A
45
54
12
32
55
78
65
45
I want to use the count how many of this is within the ranges
0-40
41-80
Please can someone advice on how to wtrite the function.
bimseun
11-20
 
J

JE McGimpsey

One way:

0-40:

=COUNTIF(A:A,"<=40") - COUNTIF(A:A, "<0")

41-80:

=COUNTIF(A:A,"<=80") - COUNTIF(A:A, "<=40")

Alternatively:

0-40:

=SUMPRODUCT(--(A1:A100<=40),--(A1:A100>=0))

41-80:

=SUMPRODUCT(--(A1:A100<=80),--(A1:A100>40))
 
D

daddylonglegs

If your numbers are all greater than or equal to zero and in range
A1:A10

=COUNTIF(A1:A10,"<=40")

If the above formula is in B1 then for 41-80

=COUNTIF(A1:A10,"<=80")-B1
 
R

Ron Rosenfeld

I hav got the following numbers:
A
45
54
12
32
55
78
65
45
I want to use the count how many of this is within the ranges
0-40
41-80
Please can someone advice on how to wtrite the function.
bimseun
11-20


=COUNTIF(rng,">=0") - COUNTIF(rng,">40")

However, depending on your application, you might be better served using the
FREQUENCY worksheet function.
--ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top