So I am writing a script that we give the sum of all the data that has a specific tag in the same row.
Col 1 | Col 2
-------+---------
grp1 | 2
grp1 |
Your problem is most likely due to the fact that you do so many calls to getRange and getValue.
You are probably hitting your quota limit of calls.
instead of doing that do one big call to get all the data and then work with that:
function collectgrpdata2(group, startrow) {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var currentcell = sheet.getActiveCell();
var col = currentcell.getColumn();
var range = sheet
.getRange(startrow,
col,
sheet.getLastRow() - startrow + 1,
sheet.getLastColumn() - col + 1)
var data = range.getValues();
return data
.filter(function(row) {return row[0] === group;})
.map(function(row) {return row[1];})
.concat(0)
.reduce(function(x,y) {return x+y;});
}