How to use getLastRow when using an array formula, in google sheets. Can I have it ignore a column?
<p>I am using the below formula in a google sheet. It works perfectly, except that I have found that getLastRow does not function, since I am using array formulas in column M-P.</p>

<p>How can I get around this? Is it possible to just have getLastRow ignore those columns? </p>

<p><a href="https://docs.google.com/spreadsheets/d/1I6t9tmo_Rvhodyc5FglUd_4THzzqBE6ykeCv0wC4Cco/edit?usp=sharing" rel="nofollow">Link to test sheet.</a> </p>

<pre><code>function onEdit(event) {
  // assumes source data in sheet named Needed
  // target sheet of move to named Acquired
  // test column with yes/no is col 4 or D
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var s = event.source.getActiveSheet();
  var r = event.source.getActiveRange();

  if(s.getName() == "Open" &amp;&amp; r.getColumn() == 9 &amp;&amp; r.getValue() == "Yes") {
    var row = r.getRow();
    var numColumns = s.getLastColumn()-2;
    var targetSheet = ss.getSheetByName("Closed");
    var target = targetSheet.getRange(targetSheet.getLastRow()+1, 1);
    s.getRange(row, 1, 1, numColumns).moveTo(target);
    s.deleteRow(row);
    s.insertRowAfter(29);
    var cell = s.getRange("H30");
    cell.setFormula("=IF(LEN(C30),MINUS(G30,TODAY()),)");
  }
}
</code></pre>