For some reason, len (data.length) is 0 when there is only one row and jumps to 2 as soon as I add a row.  I've checked to see if the function is counting one row above or below my intended range and it is not.  It counts the right amount of 'Externals' as long as I have more than one row.  I am unsure of why this may be.//Get data.length of range passed in  through argument//loop through the range based on number of rows and count 'External'function count_external(data){  var len = data.length;  var total_external = 0;  var i = 0;  for(i = 0; i < len;i++)  {   if(!data[i][0])   {     total_external += 1;   }  }  return total_external;}
Why does this FOR Loop count 0 rows with one row passed in but counts 2 after adding a second row?
google spreadsheets;google apps script