var now = new Date();
var today = Utilities.formatDate(now, 'America/New_York', 'MM/dd/yyyy');
const writeSheet2 = SpreadsheetApp.getActiveSpreadsheet().getSheets()[1];

function formulaAverage() {
  // Write the new Column Headings
  var lastColumn = writeSheet2.getLastColumn();
  var lastRow = writeSheet2.getLastRow();
  var letterColumn = writeSheet2.getRange(3, lastColumn,lastRow-3,1).getA1Notation();
  var numRows = writeSheet2.getLastRow();
  writeSheet2.getRange(numRows, lastColumn).setFormula("=AVERAGE("+ letterColumn +")");
}