title: Formula to capture timestamp on Google sheets is causing an issue
body: <p>I have a formula in google sheets which captures the timestamp when the adjacent cell is edited for the first time. See formula below</p>
  <pre><code>=if(D1,D1,if(A1&lt;&gt;&quot;&quot;,NOW(),&quot;&quot;))
  </code></pre>
  <p>The formula was working fine till around April 27th. What is happening is that the timestamp is recalculating every time the sheet is re-opened. Curiously, this recalculation is only affecting the latest 5 or so rows.
  I do have an alternative script which achieves the same purpose, but i would like to see if i can spot the bug here. I am not sure if the bug has to do something with <a href="https://support.google.com/docs/answer/58515#zippy=%2Cchoose-how-often-formulas-calculate" rel="nofollow noreferrer">how often formulas are recalculated in sheets</a>.</p>
  <p>Will appreciate any help, thanks</p>
  <p>[EDIT] Adding my code alternative here - the function runs on an on edit trigger</p>
  <pre><code>// set the timestamp when a change is done on the status columns
  function record_timestamp() 
  {
    // get information
    var ss = SpreadsheetApp.getActiveSpreadsheet(); // Sheet name
    var sheet = ss.getActiveSheet();
    var active = ss.getActiveCell();
    var row = active.getRow();
    var name = sheet.getSheetName();
    var column = active.getColumn();
    var val = active.getValue();
    
    //Logger.log(row + ' = ' + column + ' , ' + name);
    
    // if marked done or NA
    if (
      (EDIT_TABS.indexOf(name) != -1) &amp;&amp;
      (row &gt; STARTING_ROW) &amp;&amp; 
      (columnToLetter(column) == COLUMN) // helper.gs
    )
    { 
      // put in current timestamp
      var now = new Date();
      var edit_range = sheet.getRange(row, column + 1);
      
      //Logger.log('edit = ' + edit_range.getA1Notation());
      
      // put in timestamp if blank
      if (edit_range.getValue() == &quot;&quot;)
      {
        //Logger.log('setting value');
        edit_range.setValue(now);
      }  
    }
  }
  </code></pre>
  <p>[EDIT 1]
  Adding the other function which is called - this will convert the column number to an alphabet ex: 0 converts to A, and so on. Also adding the other variables used in the script.</p>
  <pre><code>// related to on edit timestamp record
  var COLUMN = 'U';
  var EDIT_TABS = ['Daily', 'Weekly', 'Monthly', 'Quarterly', 'Yearly'];
  var STARTING_ROW = 1;
  
  function columnToLetter(column)
  {
    var temp, letter = '';
    while (column &gt; 0)
    {
      temp = (column - 1) % 26;
      letter = String.fromCharCode(temp + 65) + letter;
      column = (column - temp - 1) / 26;
    }
    return letter;
  }
  
  </code></pre>