Using COUNTIF with AND

  • Thread starter Thread starter linda.taylor
  • Start date Start date
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?
 
Sorry,

strictly speaking it should be:

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

Pete
 
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!
 
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!
 
Back
Top