0

Script no Formula

I would like to change the value in the D column based on the value of the C column if the cell in C contains "YES", using a script instead of a formula.

Sample spreadsheet

  • 2
    so, what exactly do you want to accomplish ? list only products that are DONE ? – user0 Jun 12 '18 at 18:50
  • JUST CHANGE THE CELL STATUS TO "DONE", IF PRODUCT HAS ARRIVED "YES" – Julio Ricardo Jun 12 '18 at 19:20
  • but you already have it: =IF(C6="YES";"DONE";"") – user0 Jun 12 '18 at 19:32
  • 1
    I want a script... – Julio Ricardo Jun 12 '18 at 19:41
  • 1
    @user902300 Putting a lot of extra formatting (bold, etc.) doesn't really make most posts look more appealing or make them easier to read. Your edit did make an overall improvement, but much of it needed to be refined. Please edit carefully. Thanks! – jonsca Jun 12 '18 at 22:56
4

This function will update column D to "Done" when column "C" is updated to "Yes"

function onEdit() {
   var s = SpreadsheetApp.getActiveSheet();
   var r = s.getActiveCell();
      if( r.getColumn() == 3 && r.getValue() == 'Yes')
      var nextCell = r.offset(0, 1);
      nextCell.setValue("Done");
}

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.