Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/5.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 Sheets宏中的计算值设置FormulaArray中正在计算的数组的端点?_Google Apps Script_Google Sheets - Fatal编程技术网

Google apps script 如何使用Google Sheets宏中的计算值设置FormulaArray中正在计算的数组的端点?

Google apps script 如何使用Google Sheets宏中的计算值设置FormulaArray中正在计算的数组的端点?,google-apps-script,google-sheets,Google Apps Script,Google Sheets,我试图限制Google Sheets宏中公式数组中计算的单元格。我有一个var(count2)集合,其中包含今天和昨天的所有数据行的计数。我想构建一个公式数组,它只考虑行2到行count2->这个值会改变,这就是我想保留变量的原因。我已经尝试过多次在公式数组中直接调用var,但似乎都不起作用。我添加了一个示例公式; spreadsheet.getCurrentCell().setFormulaR1C1('=iferror(数组公式(iferror(sum)(如果(R3C2=R3C2:R&coun

我试图限制Google Sheets宏中公式数组中计算的单元格。我有一个var(count2)集合,其中包含今天和昨天的所有数据行的计数。我想构建一个公式数组,它只考虑行2到行count2->这个值会改变,这就是我想保留变量的原因。我已经尝试过多次在公式数组中直接调用var,但似乎都不起作用。我添加了一个示例公式;
spreadsheet.getCurrentCell().setFormulaR1C1('=iferror(数组公式(iferror(sum)(如果(R3C2=R3C2:R&count2&C2,1,0))),200))

我尝试了几种不同的调用方法,但似乎无法正确运行公式

它需要一个
+
而不是
&
。。。 所以解决办法是
spreadsheet.getCurrentCell().setFormulaR1C1('=iferror(数组公式(iferror(sum)(如果(R3C2=R3C2:R'+count2+'C2,1,0))),200)))

它需要一个
+
而不是
&
。。。 所以解决办法是
spreadsheet.getCurrentCell().setFormulaR1C1('=iferror(数组公式(iferror(sum)(如果(R3C2=R3C2:R'+count2+'C2,1,0))),200)))

真不敢相信我错过了!真不敢相信我错过了!