I wrote the code below to grab a portion of a column of numbers and add them up. However, the function is concatenating numbers rather than adding.
I'm getting this result:
0AMOUNT120123126129132135138141144147
But if I run it from Dec on the sum should be: 432
My code in Google Scripts:
//add sum and input it into the total column
function sum(startMonth, startColumn, lastRow){
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheets()[0];
  startColumn = startColumn +1;
  var sum = 0;
  var currAmount = 0;
  var k = 0;
  for(k = startMonth; k <= lastRow; k++){
   currAmount = sheet.getRange(k, startColumn).getValue();
   sum += currAmount;   //currAmount + sum;
   Logger.log(sum);
  }
  SpreadsheetApp.getActiveSheet().getRange(k, startColumn).setValue(sum);
  SpreadsheetApp.getActiveSheet().getRange(k, startColumn).setBackground("Yellow");
  return sum;
}

 
     
    