Adding a Custom Function to Google Sheets

Adding a custom function that can then be used in the formulas of your cells is relatively simple.

Some ready-to-use custom functions are available on the previous page.

If the function you need is not available, you can write it yourself (or ask for help on the forum, in the "Google Sheets" section).


Adding a Function

To add a function to a document, click on Extensions then on Apps Script and enter your custom function:

function EXAMPLE(number) {
  return number + 10;
}

In the editor, then click on Save (or save using Ctrl + S).

For this example, the custom function simply adds 10 to the number passed as an argument.

Using the Function

Then enter = followed by the name of the function and the required arguments (in this case a number, a cell containing a number, or a function returning a number):

custom function google sheets add

Note that custom functions do not appear in the list of functions (displayed when you type the first characters of the function name).