This is the result: You get subtotal sums for each of the selected columns. Usage in Sheets: =subtotalSums(A2:G31,{1,2},{6,7}) Sample Spreadsheet: https://docs.google.com/spreadsheets/d/16iDOO2otZmPVfpL75dCWR34CeiDgcdcZSNoS7j7hAVE And this is the code: // function test_SubTotals() {
// var data = [
// ['a', 'c', 'c', 5, 1],
// ['a'…