I would like to add some JS functionality to Google Sheets. Just as a test, I have written a simple summation function:
/**
This function is just to try out some JS in Google Sheets.
@customFunction
*/
function addUp(values) {
var total = 0;
for (var i = 0; i < values.length; i++) {
total = total + parseInt(values[i]);
}
return total;
}
See my screenshot of the sheet.. when entering range B2..D3 it only reads the values[0]. When entering C5..C7, it works as expected.
Is anybody familiar with this behavior?