#Short Answer Replace `if( r.getColumn() != 5 )` by `if( r.getColumn() != 5 && r.getRow() != 1 )` . #Long answer `&&` is the AND operator `r.getRow() != 1` compares the row of the edited cell with the row number that you want to be skipped. ##Full code minimal modification function onEdit() { var s = SpreadsheetApp.getActiveSheet(); var r = s.getActiveCell(); if( r.getColumn() != 5 && r.getRow() != 1) { //checks the column var row = r.getRow(); var time = new Date(); time = Utilities.formatDate(time, "GMT-07:00", "MM-dd-yyyy HH:mm:ss"); SpreadsheetApp.getActiveSheet().getRange("E" + row.toString()).setValue(time); }; }; ##Full code improved Taking advantage that onEdit() event gets an event object that include the range. function onEdit(e) { var r = e.range; if( r.getColumn() != 5 && r.getRow() != 1) { //checks the column var row = r.getRow(); var time = new Date(); time = Utilities.formatDate(time, "GMT-07:00", "MM-dd-yyyy HH:mm:ss"); SpreadsheetApp.getActiveSheet().getRange("E" + row.toString()).setValue(time); }; }; #References - [Logical Operators - Mozilla Developer Network](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_Operators) - [JavaScript Comparison and Logical Operators - w3schools.com](http://www.w3schools.com/js/js_comparisons.asp)