Hi im having trouble passing 2 cells in my scripts parameters:
function myFunction(c1, c2) {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[1]; //This is the correct sheet
var valueFirstCell = sheet.getRange(c1).getValue();
var valueSecondCell = sheet.getRange(c2).getValue();
return valueSecondCell - valueFirstCell;
}
So i use this in cell A3:
=myFunction(A1, A2)
And lets say A1=10 and A2=15 i would like A3 to show 5 but,
var valueFirstCell = sheet.getRange(c1).getValue();
fails "Argument has to be a range" Any ideas?