Counting Values

G

Guest

I am still having an issue with counting values:

I want to count the number of values in multiple cells that meet a condition.

Two of the conditions are:
Greater than 6 but less than 10
Greater than 11 but less than 15

The countif function only lets me calculate one time correctly.

When the countif function is used twice in the same cell, subtracting the
two answers, it gives me an answer that is one more than it should be.

An example of the function I have tried from another post is this:
=(COUNTIF(B2:B28,">=6")-COUNTIF(B2:B28,""<=10))
 
G

Guest

Hi
You can use countif array function:
=COUNT(IF((B2:B28>=6)*(B2:B28<10),B2:B28))+COUNT(IF((C2:C28>=11)*(C2:C28<15),C2:C28))
OR
=COUNT(IF((B2:B28>=6)*(B2:B28<10),B2:B28))+COUNT(IF((C2:C28>=11)*(C2:C28<15),C2:C28))

Once you entered function, press "Ctrl+Shift+Enter"

With regards
Rafeek M
 
G

Guest

=SUMPRODUCT((B2:B28>6)*(B2:B28<10)*(B2:B28))+SUMPRODUCT((B2:B28>11)*(B2:B28<15)*(B2:B28))
 
B

Biff

Hi!

Try these:
Greater than 6 but less than 10
=COUNTIF(B2:B28,">6")-COUNTIF(B2:B28,">=10")

Greater than 11 but less than 15

=COUNTIF(B2:B28,">11")-COUNTIF(B2:B28,">=15")

Biff
 

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