Reputation: 11
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:
Upvotes: 1
Views: 5610
Reputation: 34230
Another way is to use the mmult method to get the row totals, then follow it with a grouping or pivot query:
=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"))
Upvotes: 1
Reputation: 10573
You could use a Pivot table
Have a look at the attached spreadsheet
https://docs.google.com/spreadsheets/d/....
Please read more about how to create and use Pivot Tables
Upvotes: 2
Reputation: 1333
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, "*" ...
Upvotes: 0