Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

162
Vistas
Compare 2 columns from separate sheets and return value from adjacent cell

I am trying to compare two columns and find a match then return value from adjacent cell. I searched for answers on google but I could not find an answer that I could use. Most everything I saw did not use script but a sheets formula. the few I functions I did see didn't fit either.

function findDuplicate() {
  
  var sheet1 = SpreadsheetApp.getSheetByName('Working'); 
  var s1 = sheet1.getRange('A:A').getValues();
  var sheet2 = SpreadsheetApp.getSheetByName('Match'); 
  var s2 = sheet1.getRange('A:A').getValues();
  var mv = s1 === s2;
  var matchedValue = mv.getvalue();
  return matchedValue.offset(0, 1);

}

I am unsure how to fully do this. I understand my code is incomplete but I started down the path the best I know how. And for ease of time, yes I need this to be done in Apps Script as it will be part of another bunch of code.

example sheet link below https://docs.google.com/spreadsheets/d/1OKFoS17le-Y5SAOecoLE4EJxiKqKVjRLRHtMzwHNwxM/edit?usp=sharing

about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

Find match and return next column

function findDuplicate() {
  const ss = SpreadsheetApp.getActive();
  const sh1 = ss.getSheetByName('Working'); 
  const vs1 = sh1.getRange('H1:H' + sh1.getLastRow()).getValues();
  const sh2 = ss.getSheetByName('Match'); 
  const vs2 = sh1.getRange('A1:B' + sh2.getLastRow()).getValues();
  let o = [];
  vs1.forEach((r,i) => {
    if(r[0] == vs2[i][0]) {
      o.push(vs2[i][1]);
    }
  });
  Logger.log(JSON.stringify(o));
  return o;
}
about 4 years ago · Santiago Gelvez Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda