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 Answer 1


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 and acknowledge you have read our privacy policy.

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