I am attempting to create a manual archive function in a google sheet (based on form responses). It's a bit of a Frankenstein effort at this point as I've gathered bits and pieces to put it together. I am so close to completion, but I've hit a wall when I try to add formulas back into the sheet after clearing it to the archive.
I'm sure it's no surprise that am new to this, and I feel like I am missing something simple here. The formulas below are copied directly from the active spreadsheet where they are working fine, but for some reason, I can't get the script to parse in order to put them back after clearing the sheet. I would appreciate any assistance anyone is willing to offer.
I get the error:
Missing ) after argument list.
on the two lines of "cell.setFormula" code that won't "code block" below:
function addFormulas(){
var sheet = SpreadsheetApp.getActiveSpreadsheet();
var sourcesheet = sheet.getSheetByName("Form Totals");
//Add formula back into Column A
var cell = sourcesheet.getRange("A2:A1000");
cell.setFormula("=D2");
//Add formula back into Column U
var cell = sourcesheet.getRange("U2:U1000");
cell.setFormula("=IF(ISNUMBER(FIND("14.29",P2)),14.29,IF(ISNUMBER(FIND("5.24",P2)),5.24,""))");
//Add formula back into Column V
var cell = sourcesheet.getRange("V2:V1000");
cell.setFormula("=IF(ISNUMBER(FIND("14.29",U2)),U2*Q2,IF(ISNUMBER(FIND("5.24",U2)),U2*Q2,""))");
}
What's going on here? Are my formulas "wrong" even though they work in the spreadsheet?