Right now I'm able to paste the formula from row X to row Y, however, the calculations in the formulas are the exact same. Say row 1 is A1+B1, the formula for row 5 should be A5+B5, but I'm still getting A1+B1.
for (var x = col; x < lastCol; x++) {
for (var j = 2; j <= lastRow; j++) {
var range = sheet.getRange(j,x);
range.setFormula(formulas[0][i]);
}
i++;
}
Should I be using another function instead of setFormula or doing something else? I'm iterating over X amount of columns.

