How do I combine COUNTIF with OR

后端 未结 3 1884
礼貌的吻别
礼貌的吻别 2021-02-04 01:00

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 =COU

3条回答
  •  长情又很酷
    2021-02-04 01:43

    One option:

    =COUNTIF(B:B; "Mammal") + COUNTIF(B:B; "Bird")
    

    According to the documentation:

    Notes

    COUNTIF can only perform conditional counts with a single criterion. To use multiple criteria, use COUNTIFS or the database functions DCOUNT or DCOUNTA.

    COUNTIFS: This function is only available in the new Google Sheets.

    Example:

    =DCOUNTA(B:B; 2; {"Type"; "Mammal"; "Bird"})
    

提交回复
热议问题