Using built-in spreadsheet functions in a script

前端 未结 3 1134
情话喂你
情话喂你 2020-12-01 23:45

I\'m using Google App Script for the first time. I\'m using it on a Google Doc spreadsheet.

I\'m trying very simple functions, just to learn the basics. For example

3条回答
  •  醉话见心
    2020-12-02 00:21

    Google Apps Script is a subset of JavaScript, spreadsheet functions are currently not supported. For example, if you want to create a function that returns today's date you should write :

    function test_today(){
    return new Date()
    }// note that this will  eventually return a value in milliseconds , you'll have to set the cell format to 'date' or 'time' or both ;-)
    

    syntax is the same as with sheet functions : =test_today() see tutorial

    There are many internet ressources on javascript, one of the most useful I found is w3school

提交回复
热议问题