计算列表中的所有唯一值 + 它们的总数量和每件商品的总价格成本

Count all unique values in list + their Total quantity and Total price per Item cost

我想要以下内容:

在这里播放:https://docs.google.com/spreadsheets/d/11EHm7N4iK8N9oLb8VXrycTwPVHLmoBay4Z6dugaOr7I/edit?usp=sharing

提前致谢!

根据您的要求修改此示例。

查询:

=QUERY (A2:B7,"select A,sum(B) group by A")

截图:

最好的方法是你应该先尝试,然后想出你已经尝试过的东西/ 您的公式输出已准备就绪 sheet 如果您对此有任何疑问,请告诉我。

项目名称在范围内 E13:E16 在单元格 F13 中使用此公式进行计数并将其拖出至 F16 =sumifs(B$2:B$7,A$2:A$7, E13)

在单元格 G13 下使用此公式并将其向上拖动到 G16 成本 =vlookup(E13,A$2:C$7,3,False)*F13

这些更改的编辑权限仅限于我和你。

编辑

作为

"How about ordering the list in Item Cost from highest to lowest?"

=QUERY(A1:C9,"select A, sum(B), sum(B)*C where A is not null 
               group by A, C order by sum(B)*C desc label sum(B) 'Total Quantity', sum(B)*C 'Item Cost'" )

原回答

请使用以下公式

=QUERY(A1:C9,"select A, sum(B), sum(B)*C where A is not null 
               group by A, C label sum(B) 'Total Quantity', sum(B)*C 'Item Cost'" )

(根据您的需要调整范围)

使用的函数: