I am trying to hide a row of cell when a specific cell is filled in on Google Sheets

For example:

On row 2 cell E2 is filled in with "1", I want to be able to hide the entire second row.

Is there a possible way of doing this?

1 Answer 1


You need a script for this. This script runs on every edit (onEdit), checks whether the edit is in the 5th column (E), and if the new value is 1, then it hides the row of that cell.

function onEdit(e) {
  if (e.range.getColumn() == 5 && e.value == 1) {

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.