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 我的谷歌脚本抛出了一个;意外的字符串错误“;_Google Apps Script_Google Sheets - Fatal编程技术网

Google apps script 我的谷歌脚本抛出了一个;意外的字符串错误“;

Google apps script 我的谷歌脚本抛出了一个;意外的字符串错误“;,google-apps-script,google-sheets,Google Apps Script,Google Sheets,我用一些公式填充数组,作为数据移动脚本的一部分编写。当我试图保存Google脚本时,该行抛出“意外字符串”错误: var forms = [[,"=\"Week Averages\"","=iferror(round(average(C"+startRow+":C"+endRow+"),1),)",,,,,,, "=rept(char(9733),(round(arrayformula(

我用一些公式填充数组,作为数据移动脚本的一部分编写。当我试图保存Google脚本时,该行抛出“意外字符串”错误:

var forms = [[,"=\"Week Averages\"","=iferror(round(average(C"+startRow+":C"+endRow+"),1),)",,,,,,,
"=rept(char(9733),(round(arrayformula(sum(len(J"+startRow+":J"+endRow+")-len(SUBSTITUTE(J"+startRow+":J"+endRow+",char(9733),""))))/counta(J"+startRow+":J"+endRow+"))))&rept(char(9734),5-(round(arrayformula(sum(len(J"+startRow+":J"+endRow+")-len(SUBSTITUTE(J"+startRow+":J"+endRow+",char(9733),""))))/counta(J"+startRow+":J"+endRow+"))))",
"=rept(char(9733),(round(arrayformula(sum(len(K"+startRow+":K"+endRow+")-len(SUBSTITUTE(K"+startRow+":K"+endRow+",char(9733),""))))/counta(K"+startRow+":K"+endRow+"))))&rept(char(9734),5-(round(arrayformula(sum(len(K"+startRow+":K"+endRow+")-len(SUBSTITUTE(K"+startRow+":K"+endRow+",char(9733),""))))/counta(K"+startRow+":K"+endRow+"))))",
"=rept(char(9733),(round(arrayformula(sum(len(L"+startRow+":L"+endRow+")-len(SUBSTITUTE(L"+startRow+":L"+endRow+",char(9733),""))))/counta(L"+startRow+":L"+endRow+"))))&rept(char(9734),5-(round(arrayformula(sum(len(L"+startRow+":L"+endRow+")-len(SUBSTITUTE(L"+startRow+":L"+endRow+",char(9733),""))))/counta(L"+startRow+":L"+endRow+"))))",
"=rept(char(9733),(round(arrayformula(sum(len(M"+startRow+":M"+endRow+")-len(SUBSTITUTE(M"+startRow+":M"+endRow+",char(9733),""))))/counta(M"+startRow+":M"+endRow+"))))&rept(char(9734),5-(round(arrayformula(sum(len(M"+startRow+":M"+endRow+")-len(SUBSTITUTE(M"+startRow+":M"+endRow+",char(9733),""))))/counta(M"+startRow+":M"+endRow+"))))",
"=countif(N"+startRow+":N"+endRow+",\"=Yes\")/(countif(N"+startRow+":N"+endRow+",\"=Yes\")+countif(N"+startRow+":N"+endRow+",\"=No\"))",,,,,,,,]]
谁能帮我看看我错过了什么?我试过删除它的不同部分,但似乎无法确定问题所在。
谢谢大家!

由于引号
,您收到了一个错误。你可以:

  • 转义标记
    \“\”
  • 使用单引号
    '
    来描述字符串
    endRow+',char(9733),“”)/counta(J'+startRow
  • 使用(例如,
    `${endRow},char(9733),“))/counta(J${startRow}`