4

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?

Mogsdad
  • 42,835
  • 20
  • 145
  • 262
Farbkreis
  • 544
  • 2
  • 10

1 Answers1

2

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

Community
  • 1
  • 1
Serge insas
  • 44,113
  • 6
  • 95
  • 123