1

我正在尝试使用谷歌脚本将公式设置为单元格,但它不起作用。我的条件和双引号很少,不知道如何在工作表中添加双引号。

=if(B17<>"",IF(Form!B8 = "","",IF(Form!B8 = "Representative",index(House!A:H,MATCH(B17,House!G:G,0),8),index(House!A:H,MATCH(B17,Senate!G:G,0),8))),"")

如何将此公式添加到单元格?

4

1 回答 1

3

您是否尝试过简单地用单引号括起来?

像这样:(更新范围值)

sheet.getRange(1,1).setFormula('=if(B17<>"",IF(Form!B8 = "","",IF(Form!B8 = "Representative",index(House!A:H,MATCH(B17,House!G:G,0),8),index(House!A:H,MATCH(B17,Senate!G:G,0),8))),"")')
于 2013-04-06T17:57:46.100 回答