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

248
Views
Estoy escribiendo un script de aplicaciones de Google para multiplicar las celdas en cada fila de las columnas 22 * 26, más las columnas 28 * 29, ingresando el total en la columna 36

Tengo el siguiente script que multiplica las celdas en 4 columnas diferentes (22, 26, 28 y 29) y debo ingresar los totales en la columna 36 para cada una de las filas correspondientes; sin embargo, no sé cómo establecer los valores en las filas de la columna. 36. La línea las dsh.getRange(2, 36, data.length, data[0].length).setValues(netTotal); Creo ser incorrecto. Su ayuda es muy apreciada. Gracias

 const dss = SpreadsheetApp.openById('1YfkGTaKsZN_QlQpR901Gxfr7sc_Hxrs3wlL0u08RUm8'); const dsh = dss.getSheetByName("CONCRETE"); const lr = dsh.getIndex(); const lQ1 = dsh.getRange(2, 22, dsh.getLastRow() - 1, 17); var data = lQ1.getValues(); var netTotal = [] for (i in data){ var row = data[i]; var multiply = row[0] * row[4] + row[6] * row[7] netTotal.push([multiply]) Logger.log(netTotal) } dsh.getRange(2, 36, data.length, data[0].length).setValues(netTotal); }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Suma de dos productos por cada fila

 function myfunk() { const ss = SpreadsheetApp.openById('1YfkGTaKsZN_QlQpR901Gxfr7sc_Hxrs3wlL0u08RUm8'); const sh = ss.getSheetByName("CONCRETE"); const vs = sh.getRange(2, 1, sh.getLastRow() - 1, sh.getLastColumn()).getValues(); vs.forEach((r,i) => { sh.getRange(i + 2,36).setValue((r[21] * r[25]) + (r[27] * r[28])); }); }

o

 function myfunk() { const ss = SpreadsheetApp.openById('1YfkGTaKsZN_QlQpR901Gxfr7sc_Hxrs3wlL0u08RUm8'); const sh = ss.getSheetByName("CONCRETE"); const vs = sh.getRange(2, 1, sh.getLastRow() - 1, sh.getLastColumn()).getValues(); let vo = vs.map(r => [(r[21] * r[25]) + (r[27] * r[28]}]); sh.getRange(2,36,vo.length,vo[0].length).setValues(vo); }
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!