COUNTIF单元格包含其中一个字符串

时间:2016-08-11 15:05:47

标签: google-sheets

我希望有一个单元格状态是否包含许多字符串中的一个。

=COUNTIF(A1,"Not found")

我检查的单元格有多个" Not found" 的变体,并且不区分大小写。

我想要一个列或一个单元格,我可以声明多个字符串来触发COUNTIF,例如:

Not found
None Available
NA

到目前为止,我尝试过的COUNTIF或IF语句只允许检查一个字符串。

谢谢!

2 个答案:

答案 0 :(得分:0)

假设您有需要在B1:B3中计算的字符串,并且您要检查的范围是A列,请尝试

=sum(ArrayFormula(--regexmatch(A1:A, JOIN("|",B1:B3))))

看看是否有效?

答案 1 :(得分:0)

You better use COUNTIFS and then with a wildcard. If "not" is the word what is in every cell, you can use a wildcard like:

=countifs(A1:D1;"*not*")