When I'm scripting and want to use a standard function e.g. WEEKNUM
, is this possible directly or do I have to trigger the Formula into another field via setFormula(formula)
and afterwards read the content from the related cell?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
The approach you describe is indeed possible but not efficient at all because it needs multiple calls to spreadsheet read / write which are relatively slow...
Using Native spreadsheet functions in JavaScript (Google-Apps-Script) is otherwise not possible.
Try to find an equivalent in JavaScript instead.
If you don't know how to get some result in JS, a search on Google will in most case bring an answer.
For your example of WEEKNUM, a search would return this result for example