countif - Criterion1 OR [Criterion2 AND Criterion3]

  • Thread starter Thread starter 0-0 Wai Wai ^-^
  • Start date Start date
0

0-0 Wai Wai ^-^

I wish to do the following:
=countif(TargetCell or TargetCells, Criterion1 OR [Criterion2 AND Criterion3])

eg: =countif(A1, Criterion1 OR [Criterion2 AND Criterion3])
eg: =countif(A1:A10, Criterion1 OR [Criterion2 AND Criterion3])

How to do?

Thanks.
 
countif won't work well for this.
try sumproduct()

=sumproduct(or(targetcells=Crierion1,and(Targetcells=criterion2,targetcells=criterion3)))
 
=SUMPRODUCT(--ISNUMBER(MATCH(TargetRange,CritList,0)))

where CritList refers to a range that houses the relevant criteria.
 
Aladin Akyurek wrote...
=SUMPRODUCT(--ISNUMBER(MATCH(TargetRange,CritList,0)))

where CritList refers to a range that houses the relevant criteria.
....

That'd work for a single equality criteria, but that's not what the OP
asked. Looks like the OP needs something closer to

=SUMPRODUCT(--((range<>=Crit1)+((range<>=Crit2)*(range<>=Crit3))>0))

where <>= is just a placeholder for any of the comparison operators.
It'd be more complicated with text criteria including wildcards.
 

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

Similar Threads


Back
Top