计算清单中的所有唯一值+它们的总数量和每件商品的总价格(其中成本随时间变化)

时间:2020-06-12 15:32:29

标签: google-sheets

我想要以下内容:

  • 另一个列表中唯一值的列表
  • 在另一个列表中该值的总出现次数
  • 商品总价

成本随时间变化,因此这必须计入值的总量。

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

1 个答案:

答案 0 :(得分:2)

由于价格可能会随时间变化,因此无法使用您之前的linked question中使用的公式。

请使用以下公式考虑价格变化。

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

Total cost of products when price changing over time

使用的功能: