为什么我的Google表格QUERY函数会返回product(n())?

时间:2019-02-20 22:54:08

标签: google-sheets

我有一个查询功能,可提供2列名称和值的数据。当我尝试将第二个“选择”列标识符乘以QUERY字符串中的一个量时,它会在单元格本身上返回一个空白,并在它旁边的列上返回product(2()),下面是我的数据。如果我不使用算术运算符,则查询将正确返回而没有任何奇怪的标签。

工作查询:

=QUERY(IndustryBlueprintData!A2:H32015, 
 "select G, H where C = '" & $B34 & " Blueprint' AND D = 1", 0)

Result

奇怪的标签查询(* 2是测试值):

=QUERY(IndustryBlueprintData!A2:H32015, 
 "select G, (H * 2) where C = '" & $B34 & " Blueprint' AND D = 1", 0)

Result

1 个答案:

答案 0 :(得分:0)

这是因为(H * 2)(例如,您创建了列 H * 2的乘积)

要对其进行修复,您将需要使用label (H * 2)''对其进行标记,例如:

=QUERY(IndustryBlueprintData!A2:H32015,
 "select G, (H * 2) 
  where C = '" & $B34 & " Blueprint' 
    AND D = 1 
  label (H * 2)''", 0)