 <p></p> <pre><code>function cellB2EqualToA(e) { var sheet = e.source.getActiveSheet(); var range = e.source.getActiveRange(); var rangeA1 = range.getA1Notation(); var value = sheet.getRange(rangeA1).getValue(); if(value != 'A' &amp;&amp; rangeA1 != 'B2'){ return; }else{ //do what you need to do }; } </code></pre>