COUNTIF

S

Spencer Hutton

Is there a way to get countif to calculate this expresion.
"Count the number of cells in column A, if the corresponding cell in column
B equals yes"
TIA
 
D

Dave Peterson

Wouldn't that be the same count of the number of cells in B that are Yes?

=countif(b:b,"yes")
 
P

Peo Sjoblom

Why can't you just use

=COUNTIF(B:B,"yes")

I mean unless you have a condition that needs to be met in A the above
should be enough, if
there is a condition in A as well you can use

=SUMPRODUCT(--(A1:A200="condition1"),--(B1:B200="yes"))


--
Regards,

Peo Sjoblom

(No private emails please, for everyone's
benefit keep the discussion in the newsgroup/forum)
 
A

Aladin Akyurek

If there is nothing that must holds for column A itself...

=COUNTIF(B:B,"yes")

should suffice.

If column A must have data while column B is "yes"...

=SUMPRODUCT(1-ISBLANK(A2:A100),--(B2:B100="yes"))

The latter won't admit whole column references like A:A as range
arguments.
 

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