-1

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

5
  • 2
    so, what exactly do you want to accomplish ? list only products that are DONE ?
    – user0
    Jun 12, 2018 at 18:50
  • JUST CHANGE THE CELL STATUS TO "DONE", IF PRODUCT HAS ARRIVED "YES" Jun 12, 2018 at 19:20
  • but you already have it: =IF(C6="YES";"DONE";"")
    – user0
    Jun 12, 2018 at 19:32
  • 1
    I want a script... Jun 12, 2018 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, 2018 at 22:56

1 Answer 1

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");
}
4
  • Awesome ! Its work !! Almost there. I created a column A "Satisfation". When the row = "Done", the row "Satisfation" setValue ("OK"). Jun 13, 2018 at 11:31
  • One question...Only work with formula ? Jun 13, 2018 at 12:40
  • I dont want a formula cell. Just script. @Colin McCullough Jun 13, 2018 at 15:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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