CountIf Q

  • Thread starter Thread starter Sean
  • Start date Start date
S

Sean

Can the formula below work, I get a #Value! returned so I assume I
have a syntax wrong. Tried entering as an Array, but still the same. I
know =COUNTIF(C12:C14,"Yes") works but I want to skip C13

=COUNTIF((C12,C14),"Yes")
 
Can the formula below work, I get a #Value! returned so I assume I
have a syntax wrong. Tried entering as an Array, but still the same. I
know =COUNTIF(C12:C14,"Yes") works but I want to skip C13

=COUNTIF((C12,C14),"Yes")

=(C12="Yes")+(C14="yes")


--ron
 
Thanks Ron, knew it was simple

You're welcome. Seems COUNTIF won't take a non-contiguous range as an
argument. So you could do several COUNTIF's, but it seems simpler to just add
the equalities as Excel will automagically convert those to a 1 or 0 depending
on the result being TRUE or FALSE.

If you had several multi-cell discontiguous ranges, (as opposed to just two
cells), then serial COUNTIF's might be more efficient. eg:

=COUNTIF(A1:A10,"YES") + COUNTIF(C8:D10,"YES")


--ron
 
It can be 'persuaded'

=SUMPRODUCT(--COUNTIF(INDIRECT({"C12","C14"}),"Yes"))

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Back
Top