I am trying to figure out how to actively recalculate cell values when using script editor function the same way as googlesheet does.
For example when we have number 2 in Cell A1 and number 2 in A2 then if we do in cell A3 "=A1+A2" and then we dive the result in cell A4, if we change eiher A1 or A2 both A3 and A4 will actively update.
So in script editor if we do:
Function sum_cells(){
var sheet=SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
sheet.getRange("A1").setValue(2);
sheet.getRange("A2").setValue(2);
var cell1=sheet.getRange("A1").getValue();
var cell2=sheet.getRange("A2").getValue();
sheet.getRange("A3").setValue(cell1+cell2);
var cell3=sheet.getRange("A3").getValue();
sheet.getRange("A4").setValue(cell3/4)}
Is it possible to actively update the result in A4 and A3 if the cell values in A1 and A2 change?