Home > Software engineering >  Combine COUNTIF formulas
Combine COUNTIF formulas

Time:03-07

I need to select cels starts with this format (patern) "???. * Nr.?? CO*", and i write formula:

=IF(COUNTIF(A2;"<>???. * Nr.?? CO*");"NO";"OK")

In this selection i want to filter only cells starts wit "Pro.", "Ext." and "Fun.", and i write second formula:

=IF(SUM(COUNTIF(A2;{"Pro. *";"Ext. *";"Fun. *"}))=0;"NO";"OK")

Then i combine this both formulas in one single good formula:

=IF(OR(COUNTIF(A2;"<>???. * Nr.?? CO*");SUM(COUNTIF(A2;{"Pro. *";"Ext. *";"Fun. *"}))=0;);"NO";"OK")

And its working very well, but...

How is possible to combine both formulas without OR function? or Exist some alternatives for this result?

CodePudding user response:

Not entirely clear to me, but did you mean:

=IF(SUM(COUNTIF(A2,{"Pro","Ext","Fun"}&". * Nr.?? CO*")),"OK","NO")
  • Related