Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

113
Views
Hiding rows with blank cell in column E

I am very new to using scripts in Google Sheets, but found this simple and useful piece of code online. I am trying to hide rows in a specific range (rows 10 - 34) where the cells in column E are blank. The code below seems to hide all rows in the range regardless, even those that have a number in column E.

I have tried:

data[i][3] = 'null', 
data[i][4] = 'null', 
data[i][5] = 'null'

Any idea where I'm going wrong?

Thanks so much for any help.

function filterRows() {
    var sheet = SpreadsheetApp.getActive().getSheetByName("Print Client Report");
    var data = sheet.getDataRange().getValues();
    for(var i = 9; i < 34; i++) {
      //If column E (5th column) is "Y" then hide the row.
      if(data[i][3] = 'null') {
        sheet.hideRows(i + 1);
      }
    }
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Hiding rows where column E is null in rows 10 through 34

function filterRows() {
  var sheet = SpreadsheetApp.getActive().getSheetByName("Print Client Report");
  var data = sheet.getRange(10, 1, 25, sheet.getLastColumn()).getValues();
  data.forEach((r, i) => {
    if (!r[4]) {
      sheet.hideRows(i + 10);
    }
  });
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!