Home > Back-end >  How to use OR in criteria with countif functions?
How to use OR in criteria with countif functions?

Time:11-11

How to say find the word "Apple" or "Orange" by using or in the criteria instead of typing countif as another criteria? I mean adding OR in the same criteria.

=countif(A1:A100,"apple|Orange")

CodePudding user response:

use:

=COUNTIF(A1:A100, REGEXMATCH(A1:A100, "apple|orange"))

to make it case insensitive use:

=COUNTIF(A1:A100, REGEXMATCH(A1:A100, "(?i)apple|orange"))
  • Related