Example based on @Sandy_Good answer above. In addition, I had to work a bit to understand how to use this to automatically evaluate the cell formula for any change in the sheet. This code is slow, but I will share it as a general example in the hope that this will help, YMMV.
function forceEval(sheetName, row, col){ var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheetByName(sheetName); var orig = sheet.getRange(row,col).getFormula(); var temp = orig.replace("=", "?"); sheet.getRange(row,col).setFormula(temp); SpreadsheetApp.flush(); sheet.getRange(row,col).setFormula(orig); }
Now call it using the onEdit trigger.
function onEdit(e){ forceEval("MySheet", 1, 1) }
This temporarily rewrites the formula in cell 1.1, replacing "=" with "?", Then flush (), then brings it back, which will result in an evaluation after any editing on the worksheet.
A custom formula in a cell might look something like this: = SUMSTATUS ("MySheet", "InProgress")
Should work for: = BLOCKSPRING ("get-stock-current-stats", "ticker", "MSFT")
source share