简体   繁体   中英

On Google Sheets, how to reduce a table with multiple values per date to one row for each date and a total of the values for that date?

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?

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) ''"))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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