I have created 2 functions that run onEdit (tested and working when named onEdit)
The first one sets the value (new Date) of a row >7 in Column D onEdit of Column C.
function CompleteTime() { //Function to add a time stamp to Complete Time Column D
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var range = sheet.getActiveCell();
var row = range.getRow();
var col = range.getColumn()
if(row>7 && col==3){
sheet.getRange(row, 4).setValue(new Date());
}
}
- The second one sets a formula in Row 8 Column E onEdit of Row 8 Column D
function Duration() { //Function to set formula in column E to calculate duration from start time to first complte time
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var range = sheet.getActiveCell();
var row = range.getRow();
var col = range.getColumn()
if(row==8 && col==4){
sheet.getRange(row, 5).setFormula("=SUM(D8-B3)");
}
}
I have created 2 installable triggers to run these functions onEdit, and the first one runs fine, but the second one doesn't trigger the first one. The value that is entered by the first function doesn't trigger the second function.
Everything I've read suggests this is the way to get multiple onEdits to run in a single sheet, but I am stuck here.
CompleteTime()
to triggerDuration()
? – DiegoCompleteTime()
will never trigger an onEdit. – Diego