简体   繁体   English

如何计算谷歌表格中多列中的内容?

[英]how to count something in multiple columns in google sheets?

I need to count items per person per date in google sheets.我需要在谷歌表中计算每个人每个日期的项目。 What formula do you recommend for?你推荐什么公式? I write this but it does not work:我写这个,但它不起作用:

=countifs(A2:A11, "3/14/2020", B2:B11, "person1", D2:H11, "*")

View image:看图片:

在此处输入图片说明

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/....

Google 表格数据透视表

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM