DanCue
DanCue

Reputation: 772

Google Script Insert Formula to Non-Consecutive Cells

I've been searching for a solution for a while and have not been able to get one. I am new to Google apps script and appreciate any help with this newbie question.

Here is what I have:
spreadsheet.getRangeList(['I5', 'I10', 'I15', 'I20']).setFormula('=SUMIFS(Sheet1!$EZ:$EZ,Sheet1!$BV:$BV,"Criteria",Sheet 1!$L:$L,$A5)');

The problem is it will paste that formula to each of the cells without changing the $A5 to $A10, $A15 and $A20, respectively.

Is it possible to do what I am asking?

Upvotes: 0

Views: 95

Answers (1)

Wicket
Wicket

Reputation: 38218

Instead of using setFormula use setFormulaR1C1

Related

Upvotes: 2

Related Questions