汇总一系列现有项目和金额

时间:2019-03-30 10:34:00

标签: google-sheets google-sheets-formula

我想加快在餐饮公司的工作。我有一个包含所有产品所有成分的Excel文件。

例如:

0

https://docs.google.com/spreadsheets/d/1-AFHpl8aoIiMXz2RE1Xv7JcI7pCIMQfMoq-lQJBx5Gw/edit?usp=sharing

2 个答案:

答案 0 :(得分:1)

=ARRAYFORMULA(TRIM(SPLIT(TRANSPOSE(SPLIT(TRANSPOSE(QUERY(TRANSPOSE(QUERY(TRANSPOSE(
 IF(master!E3:Z<>"", master!A3:A&"♦"&master!B3:B&"♦"&master!E1:1&"♦"&master!E3:Z&"♠", ))
 , , 500000)), , 500000)), "♠")), "♦")))

enter image description here

=ARRAYFORMULA(QUERY({C2:C,VALUE(D2:D)},
 "select Col1,sum(Col2) 
  where Col1<>''
  group by Col1 
  order by Col1 
  label sum(Col2)'Total',Col1'Shopping List'"))

0

答案 1 :(得分:0)

以下公式适用于一种配方:

=TRANSPOSE(FILTER({E1:K1;QUERY(A1:K5,"SELECT E,F,G,H,I,J,K WHERE A='"&H25&"'", FALSE)}, NOT(ISBLANK(QUERY(A1:K5,"SELECT E,F,G,H,I,J,K WHERE A='"&H25&"'", FALSE)))))

(我以I25单元为例)。