How to count a range of number to a given parameter or criteria.

G

Guest

Hi,

I have a range (A1:A20) that contains numbers and I want to know how many
fall between 0 and 1, 1 and 2, 3 and 4, and greater than 4. I did the countif
function but it does not let me use more than 1 criteria. Can someone let me
know.
 
P

Pete_UK

Although COUNTIF only lets you use one criteria, you could have
something like this:

=COUNTIF(A1:A20,">1")-COUNTIF(A1:A20,">=2")

to get a count of the numbers above 1 and less than or equal to 2.
Vary the 1 and 2 for other ranges.

Hope this helps.

Pete
 
P

PCLIVE

You could use SUMPRODUCT.

If you truely mean "fal between" the two numbers without including the two
numbers, then:

=SUMPRODUCT(--(A1:A20>0),--(A1:A20<1))

However, if you want to include the two numbers (example: 0 and 1), then:

=SUMPRODUCT(--(A1:A20>=0),--(A1:A20<=1))

HTH,
Paul
 
B

Bob Phillips

=COUNTIF(A1:A20,">0")-COUNTIF(A1:A20,">1")

etc.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

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