1

I am trying the following in a Google Sheet which produces an error because although function_2() correctly returns an object when I test it in the editor (or when I set it to return JSON.stringify and call it in the spreadsheet directly which displays correct JSON), that object is somehow converted to an empty string when it should be passed to function_1() as a parameter:

=function_1(B2,B3,function_2(A1,A2))

Any ideas?

1 Answer 1

1

Custom functions should return a single value or an array of values in order to work in a Google Sheets formulas.

The value or values should be valid Google Sheets values, in other words, number, text, boolean or date.

JavaScript objects types that are converted to valid Google Sheets are

  • Number to number. Percentage, currency and other number formats depend on Google Sheets formatting.
  • String to text.
  • Date to date.
    • Note: Conversion to time, date-time or duration depends on cell formatting but duration could be complicated
  • Boolean to boolean.

Reference

Sign up to request clarification or add additional context in comments.

1 Comment

Got it so since I'm returning a valid JS object but not a valid GS object it's not working. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.