本文介绍了Google Spreadsheets:我如何将COUNTIF与OR结合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Google Spreadsheets中,我需要在具有多个条件的范围上使用COUNTIF函数。所以在下面的表格中,我需要像= COUNTIF(B:B,Mammal或Bird),并返回值为4的值。
A | B
-------------------
Animal |输入
-------------------
Dog |哺乳动物
Cat |哺乳动物
Lizard |爬行动物
Snake |爬行动物
Alligator | Reptile
Dove |鸟
鸡| Bird
我尝试了很多不同的方法,但都没有运气。
解决方案
一个选项:
= COUNTIF(B:B;Mammal)+ COUNTIF(B:B;Bird)
根据文档:
:此功能仅适用于新版Google表格
= DCOUNTA(B:B; 2; {Type;Mammal;Bird})
In Google Spreadsheets, I need to use the COUNTIF function on a range with multiple criteria. So in the table below I would need to have something like =COUNTIF(B:B,"Mammal"or"Bird") and return a value of 4.
A |B
-------------------
Animal | Type
-------------------
Dog | Mammal
Cat | Mammal
Lizard | Reptile
Snake | Reptile
Alligator | Reptile
Dove | Bird
Chicken | Bird
I've tried a lot of different approaches with no luck. Any help appreciated - thanks.
解决方案
One option:
=COUNTIF(B:B; "Mammal") + COUNTIF(B:B; "Bird")
According to the documentation:
COUNTIFS
: This function is only available in the new Google Sheets.
Example:
=DCOUNTA(B:B; 2; {"Type"; "Mammal"; "Bird"})
这篇关于Google Spreadsheets:我如何将COUNTIF与OR结合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!