Use existing spreadsheet formulas in a custom formula in google docs/spreadsheets

前端 未结 2 1909
隐瞒了意图╮
隐瞒了意图╮ 2021-02-06 10:20

I like writing my own formulas inside of Google Docs Spreadsheets. But often what I want to do is very similar to a function that already exists. As an example,

2条回答
  •  生来不讨喜
    2021-02-06 11:00

    I asked the same question at Google help, but did not get a solution. According to user Ahab:

    I understand the need. I voiced the same in the GAS help forum 1 very early one when GAS became available but the reaction from the GAS team was not very promising... :( In essence we'd need a GAS class that contains the spreadsheet functions do allow using them.

    Note that in general spreadsheet functions already virtually can be used as a functional programming language without the need of scripting them because of high-level functions like ArrayFormula, FILTER, SORT, UNIQUE, etc.. Unfortunately it is not possible to create e.g. substitution macro's that would allow us to quickly re-use formulas like (in pseudo-macro format):

    Name: INVERSE Description: Inverse a columnar array Syntax: #INVERSE( array ) Call: #INVERSE( #1 ) Execute: =ARRAYFORMULA(SORT( #1 ; ROW( #1 ); FALSE))

提交回复
热议问题