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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.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
If statement 如何将Select与查询()连接起来?_If Statement_Google Sheets_Google Sheets Formula_Array Formulas_Google Sheets Query - Fatal编程技术网

If statement 如何将Select与查询()连接起来?

If statement 如何将Select与查询()连接起来?,if-statement,google-sheets,google-sheets-formula,array-formulas,google-sheets-query,If Statement,Google Sheets,Google Sheets Formula,Array Formulas,Google Sheets Query,我正在使用查询函数,我想要的是将列A、B和C组合成一个字符串,并用连字符分隔它们。i、 e.“2-4-6” 我怎么能这样做 我尝试了以下操作,但返回了一个错误: =query(raw!A1:C, "select 'A & '-' & B & '-' &C") 尝试: 或使用: =ARRAYFORMULA(raw!A:A&IF(raw!B:B="",,"-"&raw!B:B)&IF(raw!C:C="",,"-"&raw!C:C

我正在使用查询函数,我想要的是将列A、B和C组合成一个字符串,并用连字符分隔它们。i、 e.“2-4-6”

我怎么能这样做

我尝试了以下操作,但返回了一个错误:

=query(raw!A1:C, "select 'A & '-' & B & '-' &C")
尝试:


或使用:

=ARRAYFORMULA(raw!A:A&IF(raw!B:B="",,"-"&raw!B:B)&IF(raw!C:C="",,"-"&raw!C:C))

谢谢有没有一种方法可以通过使用查询功能来实现这一点?不像你想象的那样,但我又添加了一种替代方法
=ARRAYFORMULA(SUBSTITUTE(TRIM(TRANSPOSE(QUERY(TRANSPOSE(raw!A1:C),,999^99))), " ", "-"))
=ARRAYFORMULA(raw!A:A&IF(raw!B:B="",,"-"&raw!B:B)&IF(raw!C:C="",,"-"&raw!C:C))