在Google Spreadsheets中,我需要在具有多个条件的范围内使用COUNTIF
函数。所以在下表中,我需要像=COUNTIF(B:B,"Mammal"or"Bird")
这样的东西并返回值4。
A |B
-------------------
Animal | Type
-------------------
Dog | Mammal
Cat | Mammal
Lizard | Reptile
Snake | Reptile
Alligator | Reptile
Dove | Bird
Chicken | Bird
我尝试了很多不同的方法而没有运气。
您还可以在SUM(COUNTIFS())构造周围使用ArrayFormula:
=ArrayFormula(SUM(COUNTIF(B:B,{"Mammal", "Bird"}))