7

I just start using a spreadsheet programming with GAS but can't find the answer to my trivial question.

I want to obtain the highest number in a column in a spreadsheet.
Opening the spreadsheet and obtaining a range is not a problem, but I don't know how to use built-in spreadsheet functions like MAX()

   var ss = openSpreadsheetByName(MyName);
   var sheet = ss.getSheets()[0];
   var lastRow = sheet.getLastRow();
   var range = sheet.range(1, 1, lastRow, 1);

Now I would like to use var maxId = range.max(); or var maxId = max(range);
In general I would like to use built-in spreadsheet functions. But don't know how.

SoftwareTester
  • 1,048
  • 1
  • 10
  • 25

1 Answers1

5

Unfortunately, this is not possible. This is one of the oldest requests for Apps Script, see issue 26 - Enable scripts to use standard spreadsheet functions.

Henrique G. Abreu
  • 17,406
  • 3
  • 56
  • 65
  • 1
    As calling built-in spreadsheet functions is one of the important feautures of VBA, the conclusion can only be that Google doesn't care about migration from Excel and/or their users. It makes you think about if it is wise using Google at all ! – SoftwareTester Jul 21 '14 at 06:26
  • Yeah, that's sad indeed. – Henrique G. Abreu Jul 21 '14 at 11:22