Set Formula with Google Apps Script

Поділитися
Вставка
  • Опубліковано 28 січ 2025

КОМЕНТАРІ • 48

  • @CedricBrown-wy7kq
    @CedricBrown-wy7kq 2 роки тому

    The instruction was brief, clear and accurate. Thank You!

    • @saperis
      @saperis  2 роки тому

      Glad it was helpful! 😀

  • @aakash9217
    @aakash9217 2 роки тому

    This videos solve my problem thanks you so much 🤩🤩

  • @MrChrisgapo
    @MrChrisgapo 2 роки тому

    Well explained! thanks a lot!

    • @saperis
      @saperis  2 роки тому

      Glad it was helpful! 👍

  • @MonaAhmednafea
    @MonaAhmednafea Рік тому

    Hi thank you for the videos!
    I have a questions here
    can I copy data from a spreadsheet to another one with the formulas the data have on the original one?

    • @saperis
      @saperis  Рік тому

      You probably would have to do this in two steps:
      1. get the data (getDataRange.getValues()) or something similar
      2. get the formulas (probably getDataSourceFormulas) developers.google.com/apps-script/reference/spreadsheet/range#getdatasourceformulas

  • @kb7494
    @kb7494 Рік тому

    I enjoyed your clear and concise video - thank you. It got me thinking about manipulating formulas using app scripts. Instead of adding a new formula to a cell, what would I do if a formula already existed in a particular cell and I wanted to update it? For example, if cell B15 contained =masterSheet1!A1 and I wanted to update it using a script to reference the same cell in another sheet, maybe =anotherSheet!A1. How do I search and replace part of the existing formula?

    • @saperis
      @saperis  Рік тому +1

      You can use the getDataSourceFormular method to get a formula from a specific cell. See here: developers.google.com/apps-script/reference/spreadsheet/range#getDataSourceFormula()

  • @dawid_dahl
    @dawid_dahl Рік тому

    Thank you kindly!

    • @saperis
      @saperis  Рік тому

      You're very welcome!

  • @segunlawal7835
    @segunlawal7835 Рік тому

    Thumbs up for the great job you are doing Saperis. Please is it possible to create multiple menu on google sheet if you want to automate more than one task / command. Also I would like to ask how do you do screen updating a feature in VBA code on Google App Script.

    • @saperis
      @saperis  Рік тому

      Check the guides to see how you can have multiple menu items: developers.google.com/apps-script/guides/menus
      I don't understand your question screen updating a feature in VBA code on Google Apps Script.

  • @alexshvetz58
    @alexshvetz58 5 місяців тому

    Very well!

  • @DhanaRama-w1m
    @DhanaRama-w1m 10 місяців тому

    hello thank you for this video!
    Do you have any recommendations if I put a reference from other sheet in the formula? For example =IF(A2>Reference!$B$2,”Yes”,”No”). I keep getting an error results

    • @saperis
      @saperis  10 місяців тому

      I've never tried that so I don't know if it works. But for sure, you would have to use the sheet name in the formula.

  • @haohuynh1808
    @haohuynh1808 Рік тому

    Hi! Do you know how to set sum of range have formula SUM() in apps script? Thank u so much.

    • @saperis
      @saperis  Рік тому

      You should be able to set the SUM formula just like I show in the video.

  • @ribierahmadalkeni8453
    @ribierahmadalkeni8453 10 місяців тому +2

    Thanks to all apps and services provided by Google but actually I'm still not believe that Google doesn't have the PDF editor app and This is the one of the big problems when I want to add any PDF or ask for a signature or add some information or marked inside the Google drive please add this features because it will keep anyone can use it inside the Google drive easily Thank you for reconsider

    • @saperis
      @saperis  9 місяців тому +1

      This is my personal UA-cam channel and I'm not Google. 😃

  • @mahendrapal6010
    @mahendrapal6010 2 роки тому

    Like this video and you help me then you one video make that save functions on multiple row and another sheet with script

    • @saperis
      @saperis  2 роки тому

      Thank you for watching the videos.

  • @Leover378
    @Leover378 2 роки тому

    Buen script en pocas líneas y muy funcional 👍

  • @hhbbhvvbjhbbyjj
    @hhbbhvvbjhbbyjj 6 місяців тому

    how about if the row changes everytime how can we use it with getlast row

  • @somayaahmadi4155
    @somayaahmadi4155 2 роки тому

    how we are able to make an alert that you have done something with an audio? for example if the quantity and produced boxes be equal make an alert with an audio? can you let me know please?

    • @saperis
      @saperis  2 роки тому +1

      There is no way to have a notification that alerts you with sound.

    • @somayaahmadi4155
      @somayaahmadi4155 2 роки тому

      thanks for replying back

  • @abdouhk1683
    @abdouhk1683 2 роки тому

    شكرا

  • @jorgepelatos2696
    @jorgepelatos2696 2 роки тому

    hi, do you know how to calculate the power of a number? in apps script? only with code?

    • @saperis
      @saperis  2 роки тому

      No, I don't. ☹

    • @bloodyping9644
      @bloodyping9644 2 роки тому

      to calculate the power of a number in apps script, use Math.pow(number,power),
      where number is your number to calculate, and power is, obviously the power to be applied to that 1st number.
      Or... you can also create your own power function, this is one of the many ways to make it works:
      function calPow(num,pow) {
      let result = num;
      if(pow >= 0) for (let i=0; ipow; i--) result = result / num;
      return result/num;
      }

  • @RajaGiri_tvpm
    @RajaGiri_tvpm 2 роки тому

    Thank you , How To Execute Google Apps Scripts on Mobiles or Tabs (Android)

    • @saperis
      @saperis  2 роки тому

      You can't execute Google Apps Script on a mobile device.
      You could have a button in a Google Sheets that triggers a script, though. Click on that button and the script should work.
      See the details here:
      stackoverflow.com/questions/50894212/getting-google-apps-scripts-to-run-on-mobile

    • @RajaGiri_tvpm
      @RajaGiri_tvpm 2 роки тому

      @@saperis Thank you very much for your kind reply

  • @LDomingos-g4z
    @LDomingos-g4z Рік тому

    It would be helpful if you link the code template in the description that way you can get leads and get paid for your work

    • @saperis
      @saperis  Рік тому

      Thanks, but that wasn't my goal with these videos.

  • @crouchingchicken007
    @crouchingchicken007 Рік тому

    Hi thank you for the videos.
    I was wondering if you could help me with an apps script formula that can minus end time of a date from start time of that day? I have data logging a Google sheet with date and time columns.

    • @saperis
      @saperis  Рік тому +1

      I don't offer any coding or consulting services. Check this directory of Apps Script freelancers: workspacedevs.com/

    • @crouchingchicken007
      @crouchingchicken007 Рік тому

      @@saperis thank you very much. I appreciate it. Was able to adapt this to my needs with a working Google sheet and pdf exports now. Thank you.

  • @rajdeepsaini2977
    @rajdeepsaini2977 2 роки тому

    Wht u have write that is not clear

    • @saperis
      @saperis  2 роки тому

      Why is it not clear?

  • @boredomindex3353
    @boredomindex3353 2 роки тому

    It's probably the least practical use of setFormula(). =SUM(B2:B14) will do the job much better, hassle free

    • @saperis
      @saperis  2 роки тому

      Thanks for sharing your thoughts.

    • @newyorkchickenwing
      @newyorkchickenwing Рік тому +1

      @@saperis I understand that the video's not so much about the Sheets formula (which is why you threw any old one in there) as it is about learning how to set ANY Sheets formula with Google Apps Script. This is actually exactly what I needed. Thanks!