[英]how to count something in multiple columns in google sheets?
You could use a Pivot table您可以使用数据透视表
Have a look at the attached spreadsheet看看随附的电子表格
https://docs.google.com/spreadsheets/d/.... https://docs.google.com/spreadsheets/d/....
Please read more about how to create and use Pivot Tables请阅读有关如何创建和使用数据透视表的更多信息
Another way is to use the mmult method to get the row totals, then follow it with a grouping or pivot query:另一种方法是使用 mmult 方法获取行总数,然后使用分组或数据透视查询进行跟踪:
=ArrayFormula(query({A2:B11,mmult(n(D2:H11="*"),transpose(column(D2:H11)^0))},"select Col2,Col1,sum(Col3) group by Col2,Col1"))
or或者
=ArrayFormula(query({A2:B11,mmult(n(D2:H11="*"),transpose(column(D2:H11)^0))},"select Col2,sum(Col3) group by Col2 pivot Col1"))
Since the range of first criteria is only one column, succeeding criteria should also use the same range, one column.由于第一个条件的范围只有一列,因此后续条件也应使用相同的范围,一列。
B2:B11, "person1", D2:D11, "*", E2:E11, "*" ...
reference: Each additional range must have the same number of rows and columns as the first range (criteria_range1 argument).参考: 每个附加范围必须与第一个范围(criteria_range1 参数)具有相同的行数和列数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.