Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google sheets 在Google Sheets中的QUERY()字符串中连接或插入数字_Google Sheets - Fatal编程技术网

Google sheets 在Google Sheets中的QUERY()字符串中连接或插入数字

Google sheets 在Google Sheets中的QUERY()字符串中连接或插入数字,google-sheets,Google Sheets,我正在尝试使用QUERY()根据其他列的内容从一个工作表调用一列数据到另一个工作表。下面的代码工作得很好 =query(Data!$A1:$Y15), "select Col7 where Col1 starts with """&E$2&""" ") 但是,我希望复制此数据并更改Col7以匹配公式所在单元格的行+1。它应该是这样的(公式在单元格F6中): 如何将数字连接或插入到查询字符串中?我确实需要使用查询,因为我在本例中简化了一些其他约束。只需使用&进行串联,就像您在E$

我正在尝试使用
QUERY()
根据其他列的内容从一个工作表调用一列数据到另一个工作表。下面的代码工作得很好

=query(Data!$A1:$Y15), "select Col7 where Col1 starts with """&E$2&""" ")
但是,我希望复制此数据并更改
Col7
以匹配公式所在单元格的行
+1
。它应该是这样的(公式在单元格F6中):


如何将数字连接或插入到查询字符串中?我确实需要使用查询,因为我在本例中简化了一些其他约束。

只需使用
&
进行串联,就像您在
E$2
中所做的那样

"select Col" & Row(F6) + 1 & " where Col1 starts with """ & E$2 & """ "
我还会在
E$2
中的字符串周围使用单引号,因为它们不需要通过加倍来转义:

"select Col" & Row(F6) + 1 & " where Col1 starts with '" & E$2 & "'"

另外,
Row(F6)
可以是返回当前单元格行的
Row()

非常感谢
"select Col" & Row(F6) + 1 & " where Col1 starts with '" & E$2 & "'"