title: How can I make a button within Google Sheets that toggles the values 1 and 0 in a destination cell?
body: <p>I am trying to learn to do basic buttons within a spreadsheet to help with a project at school. I am a simple teacher that is trying to find resources to help. I have learned how to create a button that adds one or subtracts one with the value which will allow me to do what I need to do, but ideally I am looking for script code to make a button that would toggle between the values of 1 and 0 upon pressing the button.</p>
  <p>Thanks for any help.</p>
  <pre><code>function plus1() {
    SpreadsheetApp.getActiveSheet().getRange('A1').setValue(
      SpreadsheetApp.getActiveSheet().getRange('A1').getValue() + 1
    );
  }
  </code></pre>