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

143
Views
Delete row in google sheet via app scripts if columns meet criteria

I want to be able to delete a row if certain columns match the criteria. This is what I have so far:

function deleteEachRow(){
  let tempSheet = SpreadsheetApp.getActiveSpreadsheet();
  let sheet = tempSheet.getSheetByName("Intermediate");
   var RANGE = sheet.getDataRange();
  var rangeVals = RANGE.getValues();



}

from here I would like to find out if column[11] !=='' and column[12] ==='completed', if it meets the criteria then delete the row.

Any ideas?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

function deleteEachRow(){
  const ss = SpreadsheetApp.getActiveSpreadsheet();
  const sh = ss.getSheetByName("Intermediate");
  const sr = 2;//data start row
  const rg = sh.getRange(sr, 1, sh.getLastRow() - sr + 1, sh.getLastColumn());
  const vs = rg.getValues();
  let d = 0;
  vs.forEach((r,i) => {
    if(r[10] && r[11] == 'completed') {//column 11 and 12
      sh.deleteRow(i + sr - d++);//d increments on each delete
    }
  });
}
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!