Google 表格 QUERY 公式分组

GoogleSheets QUERY Formula Grouping

这个笨蛋有点麻烦。尝试使用 QUERY 函数但想从分组中排除 D 列。我希望在 QUERY table 的每一列中看到的数据:

=QUERY(
  A:D,
  "select A,B, max(C), D where not B is null group by A,B,D label A 'Client Name',
    B 'Move-In Date',max(C) 'Check Date',D 'Amount'"
)

到目前为止,我发现在 "group by" 中包含 "Column D" 会导致出现重复的名称,但如果不在 "group by" 中包含该列,我会得到一个“#VALUE !”错误。

参见 link 示例数据:Data Test

在演示电子表格的副本上尝试以下操作。

  1. 在 G15 上添加以下公式
=QUERY(
   A:D,
   "select A,max(B), max(C) where not B is null group by A label A 'Client Name',
     max(B) 'Move-In Date',max(C) 'Check Date'"
 )
  1. 在 J15 上写入 Amount
  2. 在 J16 上添加以下公式
=ArrayFormula(vlookup(G16:G19&I16:I19,{A2:A11&C2:C11,D2:D11},2,0))