Formula Countif

S

Shona

Does any one know a formula that will countif a number is say more than 2
but less than 5.

Cheers
Shona
 
B

Bernie Deitrick

Shona,

Some variation on this will work, the variations being what you want
to do when values are exactly 2 and exactly 5:

=COUNTIF(A1:A10,">2")-COUNTIF(A1:A10,">=5")

HTH,
Bernie
MS Excel MVP
 
N

Norman Harker

Hi Shona!

One way:
=COUNTIF(A1:A10, ">2") - COUNTIF(A1:A10, ">=5")



Or:

You can use implicit if statement structures in SUMPRODUCT:

=SUMPRODUCT((A1:A10>2)*(A1:A10<5))



In this case note that A1>2 and A1<5 will evaluate as 1 or zero and
will only add to the product if both are 1.

--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
D

Don Guillett

OR
=sumproduct((a2:a22>2)*(a2:a200<5))
will get 3 & 4 . Maybe you want >=2 or <=5
 

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