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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With