4

I want something essentially like this:

function contains(arg1, arg2) {
  return NOT(ISERROR(search(arg1, arg2)));
}

But NOT and ISERROR are undefined even though using =ISERROR(...) works in the spreadsheet view.

How do I build custom formulas that can reference and combine existing formulas?

-1

Nowadays you cannot. Here is a workaround: http://www.google.com/support/forum/p/apps-script/thread?tid=21b61c4c5bf9e27c&hl=en

  • 2
    The link is no longer valid, so I'll downvote – Max L. Nov 7 '14 at 19:52
0

Google Sheets built-in functions can't be used on Google Apps Script but they could be used as arguments of custom functions and custom functions could be used as arguments of them.

It's worth to note that some Google Sheets built-in functions have direct JavaScript equivalents while others don't. By the other hand as Google Apps Script runs only on Google servers, using a built-in function usually is way faster than a custom function.

Knowing the above it doesn't make sense to use a custom function that does the same as a formula made only with built-in functions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.