I have tried to follow the example below to color E to Red if E = True Figured I would keep changing the script until

What I want is to increment the value in Col D by 1 if the Value of Col E is "True"

function myFunction() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheetByName("PlayWon");
  var TF = sheet.getRange("E2:E40").getvalues();
  For (i=0;i<40; i++) {
   var r = i+3;
   If (TF[i] = "True") {

To do a comparison instead of = use == or ===. For further details see Comparission operators. To set the value of a range instead of setBackground use setValue(value). For further details see setValue(Object).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.