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

185
Views
Analizar y contar la suma total de números - Google Apps Script

Estoy exportando elementos a la hoja de Google. Los valores de los elementos incluyen un punto en lugar de una coma, por lo que probablemente deba analizarlos primero antes de poder contar la suma total. ¿Cuál sería la mejor manera de hacer esto usando Google Apps Script? Necesito automatizar este proceso para que no pueda usar las funciones integradas de Hojas de cálculo de Google.

ingrese la descripción de la imagen aquí

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

0

Prueba esto:

 function myfunk1() { const ss = SpreadsheetApp.getActive(); const sh = ss.getSheetByName('Your sheet name'); const sum = sh.getRange(2,2,sh.getLastRow() -2,1).getDisplayValues().reduce((a,c)=>{ a+=parseFloat(c);return a;},0); sh.getRange(2,1,sh.getLastRow() - 1).getValues().forEach((r,i) => {if(r[0]=='sum')sh.getRange(i + 2,2).setValue(Number(sum).toFixed(2))}); }

Salida:

Artículo Costo
1 57,9
2 111.9
3 39.9
suma 209.7
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!