In this tutorial, you will learn how to write functions in Google Sheets.
Functions in Google Sheets are predefined formulas that automate certain calculations. There are functions to perform mathematical, statistical and logical operations, for example you can use functions to easily sum numbers, calculate the standard deviation of a sample, or use boolean logic to determine the output of a calculation.
Functions are an integral part of Google Sheets, and learning how to use them generates numerous possibilities for processing and analyzing data. Read on to learn more about Functions and how to use them.
What is a Function?
A formula in Google Sheets is anything entered in a cell that begins with an equals sign. Formulas can consist of numbers, strings, functions and other operators.
Formulas can contain functions, but this isn’t required. An example of a formula that does not contain any functions is the formula “=4+5”
An example of a formula that contains a function would be the formula “=SUM(C2:C15)”. This formula uses the SUM function to sum all values in cells in the range C2 through C15
Functions consist of the function name, which is SUM in the example above, followed by parentheses. Any references or values entered inside the function parentheses are input parameters used by that function to perform its calculations. In the example above, the range C2:C15 is being used as a single input parameter for the SUM() function. Different functions require different numbers of inputs.
Using the Functions Menu
A good place to get started with functions is by using the Functions menu. This is a handy list of available functions broken down by category, with the most frequently used at the top.
Here’s how to use the Functions Menu to add the SUM function:
Select the range you want to sum, then click on the Functions menu icon and choose SUM from the list
A formula containing the SUM() function will be automatically added to the cell beneath the selected range
If you want to add additional input parameters at this stage, type a comma to separate the existing input from the new one, then type in the new parameter. For example, the SUM function can take any number of inputs, so we can add an additional cell or range reference to the formula: “=SUM(I2:I15, A11)”.
Hit enter to complete the formula and display the calculated sum in that cell
You can also enter functions by typing them.
Select a cell and type an equals sign to start typing a formula
Type the name of the function and an open parenthesis. A popup will appear showing the required parameters. Note that any inputs displayed inside angle brackets are optional
Type the desired function parameter(s), separated by commas. Finish the function with a closing parenthesis
Hit enter to finish the formula
Example Spreadsheet: Make a copy of the example spreadsheet
In this tutorial, I covered how to write functions in Google Sheets. Want more? Check out all the Google Sheets Tutorials.