Google spreadsheets are a viable browser based alternative to desktop PC spreadsheet programs. Google spreadsheets can be easily shared over the web and accessed from any device with a web browser. A particularly exciting feature is the option to create custom spreadsheet functions and macros using JavaScript. This blog post gives an example showing how easy it is to create a spreadsheet and then write a custom function. Future posts will explore the powerful features available using macros and automation.
Creating a spreadsheet
To be able to create a spreadsheet it is necessary to have a Google account (for example through GMail). Documents should then be available as an option at the top of the browser window. This will display a window similar to that shown below:
Selecting the option to create a spreadsheet will display a window, shown below for a completed spreadsheet using a custom function for decibel addition. This spreadsheet is viewable on the web.
Creating a spreadsheet function
Custom spreadsheet functions are created in the Script Editor (under the Tools menu). This will display a window, such as that shown below. This example shows the complete code for the decibel addition function shown above. Easy, peasy with JavaScript! Please note this example needs additional error checking and to allow for multiple function arguments (additional ranges and values as input).
As can be seen, it is easy to create custom functions for a spreadsheet using JavaScript.
More Information
Web sites with further information on Google spreadsheet functions:
- Google Apps Scripting: Spreadsheet Services
- Google tutorial examples
If you need help creating custom functions for Google spreadsheets please let me know!