Using COUNTIF with AND

L

linda.taylor

This should be pretty easy; it's a little embarrasing to ask. I'm
trying to count all cells with a value within a specified range. It's
not working. Here is the formula I'm using:

=COUNTIF(A1:A17,(AND(A1:A17>3,A1:A17<6)))

Where am I going wrong?
 
P

Pete_UK

Try it this way:

=COUNTIF(A1:A17,"<6") - COUNTIF(A1:A17,"<3")

Hope this helps.

Pete
 
P

Pete_UK

Sorry,

strictly speaking it should be:

=COUNTIF(A1:A17,"<6") - COUNTIF(A1:A17,"<=3")

Pete
 
L

linda.taylor

This should be pretty easy; it's a little embarrasing to ask. I'm
trying to count all cells with a value within a specified range. It's
not working. Here is the formula I'm using:

=COUNTIF(A1:A17,(AND(A1:A17>3,A1:A17<6)))

Where am I going wrong?

That takes care of it. Thanks!
 
P

Per Jessen

Hi

You could also use this:

=SUMPRODUCT((A1:A17>3)*1,(A1:A17<6)*1)

Regards,
Per

<[email protected]> skrev i meddelelsen
This should be pretty easy; it's a little embarrasing to ask. I'm
trying to count all cells with a value within a specified range. It's
not working. Here is the formula I'm using:

=COUNTIF(A1:A17,(AND(A1:A17>3,A1:A17<6)))

Where am I going wrong?

That takes care of it. Thanks!
 

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

Similar Threads


Top