title: Real-time updates in Google Spreadsheets
body: <p>I got the following JS code:</p>
  
  <pre><code>    function sumWithoutColor(range) {
    var sheet = SpreadsheetApp.getActive();
    var range = sheet.getRange(range);
    var data = range.getValues();
  
    var sum = 0.0;
  
    for (var r in data) {
      for (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;
  }
  </code></pre>
  
  <p>This code sums up only non-colored values in Google Spreadsheet:
  <a href="https://i.stack.imgur.com/EHWHA.png" rel="nofollow noreferrer">picture</a></p>
  
  <p>Green cell contains =sumWithoutColor("I3:I17"). As you can see, this function gets argument from cells.</p>
  
  <p>When i add or delete data in white cells, or paint any cell, green cell does not updates, it contains previous value.</p>
  
  <p>How do i make this cell to update when i add/delete/modify white cells? </p>