简体   繁体   English

如何使用谷歌表格查询和求和唯一值

[英]How to query and sum unique values using google Sheets

I am trying to query a table and the 2 first columns should be used as reference, where the second column (user) should be unique as reference in the column A and the other columns should be summarized.我正在尝试查询一个表,前两列应该用作参考,其中第二列(用户)应该是唯一的,作为 A 列中的参考,其他列应该被汇总。 This is my table: enter image description here这是我的桌子:在这里输入图片描述

And I would like to be like this: enter image description here我想是这样的:在这里输入图片描述

to do this I would like to create a formula that would query this data, like =SORT(QUERY(C17:K21,"SELECT SUM(A)...",0),1,true,2,false) but I am not getting the expected result, here is the google sheets link and thanks in advance to all.为此,我想创建一个查询此数据的公式,例如 =SORT(QUERY(C17:K21,"SELECT SUM(A)...",0),1,true,2,false) 但我我没有得到预期的结果,这里是谷歌表格链接,提前感谢所有人。

Google Sheets link 谷歌表格链接

tried to create a query formula试图创建一个查询公式

You can use a QUERY like this:您可以像这样使用 QUERY:

=QUERY(A1:I9,"SELECT A,B,SUM(E),SUM(F),SUM(G),SUM(H),SUM(I) group by A,B")

在此处输入图像描述

If you want to rename the headers, add at the end of the query: label SUM(E) 'VALUE_RECEIVED', SUM(F) 'Payable 10%' and so on如果要重命名标题,请在查询末尾添加: label SUM(E) 'VALUE_RECEIVED', SUM(F) 'Payable 10%'等等

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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