Hassan Almaateeq
Hassan Almaateeq

Reputation: 131

How to use OR in criteria with countif functions?

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")

Upvotes: 1

Views: 97

Answers (2)

Hassan Almaateeq
Hassan Almaateeq

Reputation: 131

arrayformula(countifs(REGEXMATCH(A1:A100," (?i)apple|orange"), true, B1:B100, "banana"))

Upvotes: 0

player0
player0

Reputation: 1

use:

=SUMPRODUCT(REGEXMATCH(A1:A100, "apple|Orange"))

to make it case insensitive use:

=SUMPRODUCT(REGEXMATCH(A1:A100, "(?i)apple|Orange"))

enter image description here

Upvotes: 1

Related Questions