如何使用Countif函数统计Googlesheet中A列或B列有特定值的行?

How to use Countif function to count rows that has a specific value in either of column A or B in Google sheet?

我正在尝试计算具有特定值的行数,比如在 C 列或 D 列中说“John”。如果两列具有相同的值,则只计算其中一列。

这里是例子sheet。 C 和 D 列有数据。 G 列包含函数 countif

https://docs.google.com/spreadsheets/d/1i9I2bhtlHAMWqVqdE7hbkgLRLCCUrfnOMSQcf9Gj4_0/edit#gid=0

尝试:

=ArrayFormula(COUNTIF(C5:D12,F5:F7)-COUNTIFS(C5:C12,F5:F7,D5:D12,F5:F7))