9

Is it possible to use a Google Spreadsheet function in a Google Apps Script?

There is a ton of documentation about going the other way around, i.e. using Google Apps Script functions in Google Spreadsheets, but I haven't found an answer to this.

For example, let's say want to calculate a standard deviation on some data in a JavaScript array. Can I use Google Spreadsheets' STDEV function?

duozmo
  • 1,698
  • 5
  • 22
  • 33
  • dup of http://stackoverflow.com/questions/11660574/using-built-in-spreadsheet-functions-in-a-macro-google-app-script – Zig Mandel Jun 18 '14 at 14:42
  • Related: http://stackoverflow.com/questions/16303680/is-there-a-way-to-evaluate-a-formula-that-is-stored-in-a-cell/ – Rubén Nov 26 '16 at 03:43

1 Answers1

9

Unfortunately not it seems. It has been discussed/suggested/requested over the years, but I have never seen any announcements from google regarding this.

(I have edited this post to be less authoritative since I cannot readily find many resources in support of my point. However, I have been following the boards for over 3 years and have come across it at times.).

David Tew
  • 1,441
  • 1
  • 10
  • 12
  • Do you have any references you can add to back up this answer? Links to problem reports would be helpful! – Mogsdad Jul 14 '13 at 06:14
  • @Mogsdad I have edited the answer. The message is the same though. – David Tew Jul 14 '13 at 10:03
  • 1
    Yes, its not possible to do so directly (and can be confirmed so because its not in the documentation) but if you must, you could. in your example of an array that needs stdev applied, write the formula into a spreadsheet cell, then read its value. – Zig Mandel Jun 18 '14 at 14:42
  • 4
    Here's something authoritative! [Issue 26](https://code.google.com/p/google-apps-script-issues/issues/detail?id=26), with 74 stars and 32 comments over a period of 5 years. (8th most "popular" SpreadsheetService issue!) It was marked "won't fix" in 2011. – Mogsdad Jul 09 '15 at 19:27
  • What a good memory you have, Mogsdad, to return here after all this time (I, on the other hand, was simply flagged 'cos you came here.) – David Tew Sep 16 '15 at 23:31