I have a column with various text inputs. I'd like to count the number of cells that include either "word1" or "word2". So that if a single cell contains one or more of these it counts as one.

I've managed to make a formula that I think counts all occurrences of "word1" and "word2", but I'm only after the amount of cells containing one of them (or any number of them).

What is the formula for this?

有帮助吗?

解决方案

You can use an array formula:

=ARRAYFORMULA(SUMPRODUCT(((ISNUMBER(SEARCH("word1",A1:A5))+ISNUMBER(SEARCH("word2",A1:A5)))>0)*1))

That formula was based on barry houdini's answer a while ago.

Just change the range as required.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top