countif using cell references in criteria

H

Hall

Can I use cell references in criteria of the function countif? Can I do
this using a boolean function?

Here's what I want:

=countif( A1:A100, and( >B1, < C1 ) )

ie, count only if the number in the range is between the numbers in b1 and
c1.
 
B

Bob Phillips

You can

=COUNTIF(A1:A100,">"&B1)

but you cannot have two conditions

=SUMPRODUCT(--(A1:A100>B1),--(A1:A100<C1))

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
H

Hall

Excellent! Thanks!

Bob Phillips said:
You can

=COUNTIF(A1:A100,">"&B1)

but you cannot have two conditions

=SUMPRODUCT(--(A1:A100>B1),--(A1:A100<C1))

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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