This tutorial explains the steps required for creating a custom function in Google Spreadsheet. Let us say you want to display “Hello World” message in a cell. Now to add a custom function using Google Apps Script, click the Tools menu and select Script editor from the menu list.
In the script editor add a function for displaying the message as shown below.
Click the save icon after adding the displayText() function.
Now navigate to your spreadsheet and type =displaytext() on a cell to print the Hello World message.
Google Spreadsheet is not as powerful as Excel with respect to built-in function but by creating custom functions you can bridge this gap.