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

119
Views
Check dataRange for duplicate values

So I have a datarange "values" below. How can I simply find the duplicates within the datarange. I.E. rows C4/D4 says "something,here" and row C10/D10 says "something,here" it would log my 2 duplicates

function checkforDups() {

   var ss = SpreadsheetApp.getActiveSpreadsheet();
   var sheet = ss.getSheetByName("Form Responses 1");
   var values = sheet.getRange("C2:D100").getValues();

   //Logger.log(values)

   for (var i = 0; i < values.length; i++) {
      Logger.log(values[i]);
   }

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

0

Find duplicates

function checkforDups() {
  const ss = SpreadsheetApp.getActive();
  const sh = ss.getSheetByName("Form Responses 1");
  const vs = sh.getRange(2, 3, 99, 2).getDisplayValues();
  let uA = [];
  vs.forEach((r, i) => {
    let x = r.join(',')
    if (!~uA.indexOf(x)) {
      uA.push((x));
    } else {
      sh.getRange(i + 2, 1, 1, 2).setBackground("#ffff00");
    }
  });
}
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!