【问题标题】:Google Sheet Query SUM exclude IF is not blankGoogle Sheet Query SUM exclude IF 不为空
【发布时间】:2019-10-05 19:41:49
【问题描述】:

在标签 “Invoice WholeSale” 中,单元格 “B3” 我需要一个查询来对标签求和:

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

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

这里是my Google sheet

例如,我希望从选项卡:
“库存仓库移动”

从标签
“Stock Shop Moves”

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

=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 分组:

【问题讨论】:

  • 你能添加想要的输出吗?
  • 是的,是最后一张照片。如您所见,分组依据:“书店 1”和“书店 2”

标签: arrays google-sheets google-sheets-formula google-sheets-query google-query-language


【解决方案1】:

试试这样:

=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)

【讨论】:

  • 试试:=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 order by Col8 asc label count(Col8)''", 0)
猜你喜欢
  • 2019-01-28
  • 2021-03-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-04-30
  • 2021-09-08
  • 2021-08-26
相关资源
最近更新 更多