Google表格查询SUM排除,如果不为空

问题描述 投票:0回答:1

在选项卡“ Invoice WholeSale”中,单元格“ B3”我需要查询以汇总选项卡:

  • “库存仓库移动”
  • “股票商店移动”

但是按WholeSale列分组,并忽略此列中没有文本的行。

这里是my Google sheet

例如,我希望从标签中找到:“”库存仓库移动“

0

并且来自选项卡“股票商店动向”

0

我尝试了这个,但是不起作用:

=query('Stock Warehouse Moves'!A3:I,"select H, sum(B) where (H is not null) group by H"{'Stock Shop Moves'!A3:I,"select H, sum(B) where (H is not null) group by H"})

并且这个,但是不能正确显示数据:

=query('Stock Shop Moves'!A3:I,"select H, sum(B) where (H is not null) group by H")

我希望下一个由WholeSale分组的人:

0

arrays google-sheets google-sheets-formula google-sheets-query google-query-language
1个回答
0
投票

尝试这样:

=QUERY({'Stock Warehouse Moves'!A3:H; 'Stock Shop Moves'!A3:H},
 "select Col1,count(Col8),Col8 
  where Col8 is not null 
  group by Col1,Col8 
  label count(Col8)''", 0)

0

© www.soinside.com 2019 - 2024. All rights reserved.