Home > Net >  On Google Sheets, how to reduce a table with multiple values per date to one row for each date and a
On Google Sheets, how to reduce a table with multiple values per date to one row for each date and a

Time:02-19

I have something like this:

date        value
2022/01/02  4
2022/01/02  3
2022/01/01  2
2022/01/01  1

and I want another table computed from that which has a single row for each date and the sum of the values for that date:

Date        Value
2022/01/02  7
2022/01/01  3

etc...how?

CodePudding user response:

solution #1

Use a pivot table to do what you expect !

solution #2

=SORT(QUERY(A2:B,"select A,sum(B) group by A label sum(B) ''"))

with duration, use

=SORT(QUERY({A2:A,arrayformula(value(B2:B))},"select Col1,sum(Col2) group by Col1 label sum(Col2) ''"))
  • Related