Google Spreadsheet multiple column filter using OR

雨燕双飞 提交于 2019-12-03 02:16:32

The formula below should do what you are after:

=ROWS(FILTER(A2:A, NOT(ISBLANK(A2:A)), NOT(ISBLANK(B2:B))+NOT(ISBLANK(C2:C)) ))

And to explain:

  • ROWS counts the rows of the argument (filtered, in our case)
  • FILTER returns the rows of arg1 (A2:A) that all subsequent arguments match
  • The + (addition) symbol combines two predicates with a logical OR

Finally, if you are not using header columns you can change the references from A2:A to A:A

Alternatively, you can use the QUERY function:

(Broken into multiple lines for readability)

=ROWS(QUERY(A2:C, 
    "SELECT A WHERE A IS NOT NULL AND (B IS NOT NULL OR C IS NOT NULL)"))

For more information on the syntax of the queries, see the Visualization API Query Language Reference and specifically the Language Reference

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!