I have researching this but cannot find a suitable solution. The following formula works fine at the formula level when placed in a sheet cell. The issue is I want the formula to run at the script level. The options I am aware of include running a script to: (1) set.Formula('=complex formula') or (2) rewriting the entire formula as a script
I am new to GAS, and have messed around with both methods. There seems to be a syntax error when using option (1), usually in the form of a missing ")" that I cannot debug. Employing option (2) is currently above my skill level. Any help on either option would be greatly appreciated.
Here is the formula in question:
=ARRAYFORMULA(QUERY({UI!A:G,YEAR(UI!A:A),MONTH(UI!A:A), TEXT(UI!A:A, "MMMM"), TEXT(UI!A:A, "MMM-YY"), REPLACE(UI!A:A,1,1000,"GRAND TOTAL")}, "SELECT * WHERE Col1 IS NOT NULL AND Col2 IS NOT NULL LABEL Col8 'Year',Col9 'MonthMO#',Col10 'MonthMO',Col11 'MonthMOYR',Col12 'GRAND TOTAL'"))
set.Formula(`=complex formula`)syntax (note the grave accents instead of apos/quote) this lets you avoid the toothpick problem. en.wikipedia.org/wiki/Leaning_toothpick_syndrome - dandavis=complex formula) using chrome version 46.0.2490.80 m. with no luck. The script editor returns "illegal character" error on testing. - robazefa