javascript - Real-time updates in Google Spreadsheets -


i got following js code:

    function sumwithoutcolor(range) {   var sheet = spreadsheetapp.getactive();   var range = sheet.getrange(range);   var data = range.getvalues();    var sum = 0.0;    (var r in data) {     (var c in data[r]) {       var x = parseint(r, 10) + 1;       var y = parseint(c, 10) + 1;       var cell = range.getcell(x, y);       if (cell.getbackground() == '#ffffff') {         sum += parsefloat(data[r][c]) || 0.0;       }     }   }    return sum; } 

this code sums non-colored values in google spreadsheet: picture

green cell contains =sumwithoutcolor("i3:i17"). can see, function gets argument cells.

when add or delete data in white cells, or paint cell, green cell not updates, contains previous value.

how make cell update when add/delete/modify white cells?


Comments