.setFormula() and received error missing ) argument list
I have .setFormula()
and stuck on this. I think the problem is the comma (&","
). I have researched several online forum before posting this question but no luck; perhaps someone here could help me out. I do know the rules about using the ""
and ''
that's why I have tried several formulas but still, I receive the error message:
"Missing ) after argument list".
Your time and help is appreciated!
Original formula:
=arrayformula(concatenate(filter('Sheet1'!E2:E,'Sheet1'!E2:E<>"")&", "))
code:
me.getRange('B8').setFormula("=arrayformula(concatenate(filter('Sheet1'!E2:E,'Sheet1'!E2:E<>"") & ", "))");
Formulas I have tried but failed:
"=arrayformula(concatenate(filter('Sheet1'!E2:E,'Sheet1'!E2:E<>'') & ', '))");
'=arrayformula(concatenate(filter('Sheet1'!E2:E,'Sheet1'!E2:E<>'') & ', '))');
"=arrayformula(concatenate(filter('Sheet1'!E2:E,'Sheet1'!E2:E<>'') & ", "))");
'=arrayformula(concatenate(filter("Sheet1"!E2:E,"Sheet1"!E2:E<>"") & ", "))');
Solution 1:
You dont need single quotes '
around Sheet1
.
Try
me.getRange('B8')
.setFormula('=arrayformula(concatenate(filter(Sheet1!E2:E,Sheet1!E2:E<>"") & ", "))"');
If you still need it, you need to escape it with backlashes like this \'
:
me.getRange('B8')
.setFormula('=arrayformula(concatenate(filter(\'Sheet1\'!E2:E,\'Sheet1\'!E2:E<>"") & ", "))"');
Reference:
String § Escape notation