Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

100
Visualizações
Concate String to a formula in app script

I have a values in google sheet and the format is =+40,-58. This give me ERROR! because the sheet is taking it as formula. I can manually edit this by adding ' single qoute before equal sign but when i append qoute using script it append qoute with ERROR!. Tried multiple thing like getting cell type, convert it to string. Tried set formula method but it appends another equal sign before the cell value

please check the code below

if (//my condition){
      
 sheet.getRange(i,col_in+1).setValue("'"+colvalue)

I am looking for possible solutions like, how can I get the actual value of the cell from fx or How can i append a single quote with the cell value instead of appending quote with ERROR.

please see the screenshot of the sheet Sheet

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Descrition

Because the formula is giving "#ERROR" you need to getFormula and use setValue

Script

function test() {
  let cell = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1").getRange("A6");
  let value = cell.getFormula();
  if( value !== "" ) {
    console.log("formula = "+value);
    cell.setValue("'"+value);
  }
}

Console.log

7:30:31 AM  Notice  Execution started
7:30:31 AM  Info    formula = =+52,-64
7:30:32 AM  Notice  Execution completed
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda