EDIT
(following OP's comment
I need exactly all criteria . If disposition is "consultation " AND primary is either "Ob"or"surgical" And consultation contains eithe" IM"or "cardio"....
You can easily alter the formula with something like the following
=ArrayFormula(sum(
N(REGEXMATCH({disposition, Primary, Consultations},"xx|yy|Neuro|GI")),
N(REGEXMATCH({disposition},"zz|ABD")),
N(REGEXMATCH({Primary},"Cardio|Nephro")),
COUNTBLANK(disposition),
COUNTBLANK(Primary)
))
The basic difference is COUNTBLANK
that we bring in our formula because we can not count blanks using the regex.
Original answer
Instead of your countifs formula you could try the following
=ArrayFormula(SUM(N(REGEXMATCH({disposition, Primary, Consultations},
"IM|Cardio|Nephro|Neuro|GI"))))
What the formula does
- Using the
REGEXMATCH
in combination with the ArrayFormula
function we come up with TRUE
or FALSE
results.
- Because though,
TRUE
and FALSE
correspond to 1
and 0
values, we use the N
function to turn them to 1
s and 0
s respectively.
- Finally we
SUM
to get the desired result.