Here's an example of how I did that. The script is set to trigger whenever a form is submitted.
function insertAverage() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0];
var formulas = [
["=AVERAGE(C3:C100)", "=AVERAGE(D3:D100)", "=AVERAGE(E3:E100)"]
];
var destination = sheet.getRange("C2:E2");
destination.setFormulas(formulas);
};
No comments:
Post a Comment