I'm trying to use set formula but it keeps saying I'm having an issue with my syntax but I'm not exactly sure how to fix it. I'm trying to use declared variables as the inputs to the formula.
The bold line below is where I'm having the problem.
function LEARNBASICS() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var currentsheet = ss.getActiveSheet();
var targetsheet = currentsheet.getRange(17,17).getValue();
var startrange = currentsheet.getRange(18,17).getValue();
var endrange = currentsheet.getRange(19,17).getValue();
var currentcell = currentsheet.getCurrentCell();
return currentcell.setFormula("=COUNTIF('targetsheet'!'startrange':'endrange',">0")")
}