Usar fórmula avançada na tabela

  • Profile Image
    usimig2020
    Perguntado em 26 de novembro de 2025 às 09:23

    Bom dia,


    Seria possível saber quantos dias de diferença há entre 2 datas?


    Por exemplo: a data de envio e a data de execução, para que eu consiga saber a quantidade de dias da diferença das datas.

  • Profile Image
    Podo: Support AI Agent
    Respondido em 26 de novembro de 2025 às 09:23

    Oi,

    Obrigado por entrar em contato com o Suporte Jotform. Posso ajudar você com isso.

    Para calcular a diferença em dias entre duas datas, como a data de envio e a data de execução, você pode usar a função DATETIME_DIFF em Jotform Tables. Essa função retorna a diferença entre duas datas em unidades especificadas, como dias.

    Veja como fazer:

    1. Abra sua tabela no Jotform Tables e adicione uma nova coluna.
    2. Escolha o tipo de coluna como Fórmula Avançada (Advanced Formula).
    3. Use a fórmula: =DATETIME_DIFF({Data de Execução},{Data de Envio},"days") substituindo {Data de Execução} e {Data de Envio} pelos nomes reais das colunas das datas no seu formulário.

    Isso calculará automaticamente a quantidade de dias entre as duas datas para cada linha da tabela.

    Além disso, você pode usar o widget Date Difference no construtor de formulários para calcular a diferença entre datas diretamente no formulário, se preferir.

    Se precisar de ajuda para configurar isso, me avise.

    Experimente e me diga como foi.

  • Profile Image
    usimig2020
    Respondido em 26 de novembro de 2025 às 09:24

    e quando um dos campos está vazio como eu uso o IF para ele retornar vazio, caso o campo esteja vazio

  • Profile Image
    Podo: Support AI Agent
    Respondido em 26 de novembro de 2025 às 09:24

    Oi,

    Para usar a função IF em uma fórmula avançada no Jotform Tables e fazer com que retorne vazio caso um dos campos de data esteja vazio, você pode estruturar a fórmula assim:

    =IF(OR(ISBLANK({Data de Envio}), ISBLANK({Data de Execução})), "", DATETIME_DIFF({Data de Execução}, {Data de Envio}, "days"))

    Essa fórmula faz o seguinte:

    • Verifica se {Data de Envio} ou {Data de Execução} estão vazios usando ISBLANK.
    • Se algum dos campos estiver vazio, retorna uma string vazia "".
    • Se ambos estiverem preenchidos, calcula a diferença em dias entre as datas com DATETIME_DIFF.

    Assim, você evita que a fórmula retorne um valor quando uma das datas não estiver preenchida.

    Se precisar de mais ajuda, estou à disposição.

  • Profile Image
    usimig2020
    Respondido em 26 de novembro de 2025 às 09:35

    Usar fórmula avançada na tabela Image 1 Screenshot 20

  • Profile Image
    Mikhail Jotform Support
    Respondido em 26 de novembro de 2025 às 12:41

    Hi usimig2020,

    Our Portuguese Support agents are busy helping other Jotform users right now, so I'll try to help you in English using Google Translate, but you can reply in whichever language you feel comfortable using. Or, if you'd rather have support in Portuguese, let us know and we can have them do that. But, it might take a while until they're available again.

    Now, coming back to your question, I understand the issue. Let me look into it and get back to you with a solution.

  • Profile Image
    Mikhail Jotform Support
    Respondido em 26 de novembro de 2025 às 14:37

    Hi usimig2020,

    Can you give me a few more details so I can understand what you need? Do you have a custom table created without any connected form? If it’s connected to a form, can you share your form link with me so I can take a closer look?

    Also, if it's connected to a form, you can add Date Difference Widget to get the days difference between two dates. Currently, you can't display the Number of Days calculated by the Date Difference Widget directly. But, there’s a workaround to show it in your form. Let me show you how to do it:

    1. In Form Builder, click on Add Element on the left side of the page.

    2. Then, in the menu that opens, click on Widgets in the top-right corner.

    3. Next, click on the Form Calculation Widget to add it to your form.

    Usar fórmula avançada na tabela Image 1 Screenshot 40

    4. In the menu that opens on the right, click on the Add Field button.

    5. Then, select the Date Difference Widget in the Dropdown menu.

    Usar fórmula avançada na tabela Image 2 Screenshot 51 That’s it. As soon as your Date Difference widget is filled out, the date difference between the entered date will be displayed in the Form Calculation widget. Check out this screencast below:

    Usar fórmula avançada na tabela Image 3 Screenshot 62 Reach out again if you need any other help.

  • Profile Image
    usimig2020
    Respondido em 26 de novembro de 2025 às 15:49

    Não queria colocar no formulário, mas acrescentar como uma coluna na tabela

  • Profile Image
    Mikhail Jotform Support
    Respondido em 26 de novembro de 2025 às 16:24

    Hi usimig2020,

    Can you try using the formula below on your Table?

    =IF(OR(YEAR({startdate})=1900,YEAR({enddate})=1900),"",DATETIME_DIFF({stardate},{enddate},"days"))

    This is what it looks like when a field is blank:

    Usar fórmula avançada na tabela Image 1 Screenshot 20

    Give it a try and let us know how it goes.

  • Profile Image
    usimig2020
    Respondido em 27 de novembro de 2025 às 13:34

    Deu certo, obrigada

  • Profile Image
    Podo: Support AI Agent
    Respondido em 27 de novembro de 2025 às 13:34

    Hi usimig2020,

    Your request has been answered and the thread is closed.

    If you have another question or need more help, feel free to reply here and we’ll assist you right away.

Your Reply