您如何总结然后再处理结果?

时间:2020-08-05 17:06:27

标签: google-sheets google-sheets-formula transpose array-formulas google-sheets-query

此图显示了我需要实现的目标。我不知道该怎么做。 任何帮助都将受到欢迎。

enter image description here

1 个答案:

答案 0 :(得分:1)

也许:

=ARRAYFORMULA(QUERY(SPLIT(FLATTEN(IF(B2:D="",,A2:A&"♀"&B1:D1&"♀"&B2:D)), "♀"), 
 "where Col2 is not null", 0))

enter image description here

或者也许:

=ARRAYFORMULA(QUERY(SPLIT(FLATTEN(IF(B2:D="",,A2:A&"♀"&B1:D1&"♀"&B2:D)), "♀"), 
 "select Col1,Col2,sum(Col3) 
  where Col2 is not null 
  group by Col1,Col2 
  order by Col1,Col2,sum(Col3) 
  label sum(Col3)''", 0))

enter image description here