New to JS. Working with it in google sheets. For some reason, i can't get the nested if to filter out at the bottom. code is not finished. the log is at the very bottom. it should only log 4 times. Please tell me that JS in Google sheets is not that flaky.
[17-10-30 17:05:01:659 EDT] false true
[17-10-30 17:05:01:661 EDT] false true
[17-10-30 17:05:01:663 EDT] false true
[17-10-30 17:05:01:665 EDT] true true
[17-10-30 17:05:01:667 EDT] false true
[17-10-30 17:05:01:669 EDT] false true
[17-10-30 17:05:01:670 EDT] false true
[17-10-30 17:05:01:672 EDT] false true
[17-10-30 17:05:01:674 EDT] false true
[17-10-30 17:05:01:676 EDT] false true
[17-10-30 17:05:01:677 EDT] false true
[17-10-30 17:05:01:679 EDT] false true
[17-10-30 17:05:01:680 EDT] false true
[17-10-30 17:05:01:682 EDT] false true
[17-10-30 17:05:01:683 EDT] false true
[17-10-30 17:05:01:685 EDT] false true
[17-10-30 17:05:01:687 EDT] false true
[17-10-30 17:05:01:689 EDT] false true
[17-10-30 17:05:01:691 EDT] false true
[17-10-30 17:05:01:692 EDT] false tru
JavaScript:
function loopsearch(){
//looking for 'find me'
var app = SpreadsheetApp;
var str = "Team Name:";
var strcell = "";
var icount = 0; //counts number of team name instances in column A of Breakdown sheet
var irowstart = 0;//starting row # for personnel names in team
var inamecount = 0;//number of names for a team
var i2 = 0;
var i3 = 0;
Logger.clear();
//files will be built one team at a time then irowstart and inamecount will be reset
// Logger.log("Start here");
//active sheet
var activeSheet = app.getActiveSpreadsheet().getActiveSheet();
//loop will add 5 to cell with existing values
for(var i=1;i<1000;i++){
var sCell = activeSheet.getRange(i+0,1).getValue();
strcell = sCell;
i2 = strcell.indexOf("Team")>=0;
// Logger.log("i2 = "+ i2);
if (strcell);{
if (strcell.indexOf("Team")>=0);
{
icount++;
Logger.log(i2+" "+true);
irowstart = icount;
// Logger.log("inside if 2 = " + icount);
}
}
}
}
[17-10-30 17:05:01:659 EDT] false true
[17-10-30 17:05:01:661 EDT] false true
[17-10-30 17:05:01:663 EDT] false true
[17-10-30 17:05:01:665 EDT] true true
[17-10-30 17:05:01:667 EDT] false true
[17-10-30 17:05:01:669 EDT] false true
[17-10-30 17:05:01:670 EDT] false true
[17-10-30 17:05:01:672 EDT] false true
[17-10-30 17:05:01:674 EDT] false true
[17-10-30 17:05:01:676 EDT] false true
[17-10-30 17:05:01:677 EDT] false true
[17-10-30 17:05:01:679 EDT] false true
[17-10-30 17:05:01:680 EDT] false true
[17-10-30 17:05:01:682 EDT] false true
[17-10-30 17:05:01:683 EDT] false true
[17-10-30 17:05:01:685 EDT] false true
[17-10-30 17:05:01:687 EDT] false true
[17-10-30 17:05:01:689 EDT] false true
[17-10-30 17:05:01:691 EDT] false true
[17-10-30 17:05:01:692 EDT] false tru