Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.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/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 apps script GoogleSheet:如何内爆查询结果的范围_Google Apps Script_Google Sheets_Spreadsheet - Fatal编程技术网

Google apps script GoogleSheet:如何内爆查询结果的范围

Google apps script GoogleSheet:如何内爆查询结果的范围,google-apps-script,google-sheets,spreadsheet,Google Apps Script,Google Sheets,Spreadsheet,我有一张教师表和一张班级表,每个班级都与一名教师相关联,一名教师可以教多个班级。在教师工作表中,我想要一个列来显示教师所教的课程,课程之间用,分隔 使用Query函数,我能够检索特定教师正在教授的课程的单列范围 QUERY('Class'!A:I,"select B where G='John Smith'") //The Class sheet's rightmost column is `I`, column B is `Class_Name` and column

我有一张教师表和一张班级表,每个班级都与一名教师相关联,一名教师可以教多个班级。在教师工作表中,我想要一个列来显示教师所教的课程,课程之间用
分隔

使用
Query
函数,我能够检索特定教师正在教授的课程的单列范围

QUERY('Class'!A:I,"select B where G='John Smith'")  
//The Class sheet's rightmost column is `I`, column B is `Class_Name` and column G is `Class_Teacher`.
然而,我找不到一个公式来“内爆”这个结果,
,我能找到的结论是
串联

concatenate(QUERY('Class'!A:I,"select B where G='John Smith'"))
这将输出John Smith在没有
的情况下教授的所有课程。这可以通过fomula完成吗?或者我必须在应用程序脚本中编写自定义fomula?

是的,您可以使用JOIN()函数

=JOIN(",", QUERY('Class'!A:I,"select B where G='John Smith'")))
看或