4 - Functions
4 - Functions
4 - Functions
Functions
Introduction
A function is a predefined formula that performs calculations using specific values in a particular order. Excel
includes many common functions that can be used to quickly find the sum, average, count, maximum value, and
minimum value for a range of cells. In order to use functions correctly, you'll need to understand the different
parts of a function and how to create arguments to calculate values and cell references.
The parts of a function
In order to work correctly, a function must be written a specific way, which is called the syntax. The basic
syntax for a function is the equals sign (=), the function name (SUM, for example), and one or more arguments.
Arguments contain the information you want to calculate. The function in the example below would add the
values of the cell range A1:A20.
Multiple arguments must be separated by a comma. For example, the function =SUM(A1:A3, C1:C2, E1) will add
the values of all of the cells in the three arguments.
Creating a function
There are a variety of functions available in Excel. Here are some of the most common functions you'll use:
SUM: This function adds all of the values of the cells in the argument.
AVERAGE: This function determines the average of the values included in the argument. It calculates the sum of
the cells and then divides that value by the number of cells in the argument.
COUNT: This function counts the number of cells with numerical data in the argument. This function is useful
for quickly counting items in a cell range.
MAX: This function determines the highest cell value included in the argument.
MIN: This function determines the lowest cell value included in the argument.
2. In the Editing group on the Home tab, click the arrow next to the AutoSum command. Next, choose the
desired function from the drop-down menu. In our example, we'll select Sum.
3. Excel will place the function in the cell and automatically select a cell range for the argument. In our example,
cells D3:D12 were selected automatically; their values will be added to calculate the total cost. If Excel selects
the wrong cell range, you can manually enter the desired cells into the argument.
4. Press Enter on your keyboard. The function will be calculated, and the result will appear in the cell. In our
example, the sum of D3:D12 is $765.29.
Microsoft Excel Training - Functions 4
*The AutoSum command can also be accessed from the Formulas tab on the Ribbon.
You can also use the Alt+= keyboard shortcut instead of the AutoSum command. To use this shortcut, hold
down the Alt key and then press the equals sign.
Microsoft Excel Training - Functions 5
2. Type the equals sign (=), and enter the desired function name. You can also select the desired function from
the list of suggested functions that appears below the cell as you type. In our example, we'll type =AVERAGE.
3. Enter the cell range for the argument inside parentheses. In our example, we'll type (C3:C9). This formula will
add the values of cells C3:C9, then divide that value by the total number of values in the range.
Microsoft Excel Training - Functions 6
4. Press Enter on your keyboard. The function will be calculated, and the result will appear in the cell. In our
example, the average number of units sold by each troop is 849.
*Excel will not always tell you if your formula contains an error, so it's up to you to check all of your formulas.
To learn how to do this, read the Double-Check Your Formulas lesson from our Excel Formulas tutorial.
Microsoft Excel Training - Functions 7
2. Click the Formulas tab on the Ribbon to access the Function Library.
3. From the Function Library group, select the desired function category. In our example, we'll choose More
Functions, then hover the mouse over Statistical.
Microsoft Excel Training - Functions 11
4. Select the desired function from the drop-down menu. In our example, we'll select the COUNTA function,
which will count the number of cells in the Items column that are not empty.
Microsoft Excel Training - Functions 12
5. The Function Arguments dialog box will appear. Select the Value1 field, then enter or select the desired cells.
In our example, we'll enter the cell range A3:A12. You may continue to add arguments in the Value2 field, but
in this case we only want to count the number of cells in the cell range A3:A12.
6. When you're satisfied, click OK.
7. The function will be calculated, and the result will appear in the cell. In our example, the result shows that a
total of 10 items were ordered.
Microsoft Excel Training - Functions 13
2. Click the Formulas tab on the Ribbon, then click the Insert Function command.
5. Review the results to find the desired function, then click OK. In our example, we'll choose NETWORKDAYS,
which will count the number of business days between the ordered date and received date.
6. The Function Arguments dialog box will appear. From here, you'll be able to enter or select the cells that will
make up the arguments in the function. In our example, we'll enter E3 in the Start_date field and F3 in the
End_date field.
7. When you're satisfied, click OK.
Microsoft Excel Training - Functions 15
8. The function will be calculated, and the result will appear in the cell. In our example, the result shows that it
took four business days to receive the order.
*Like formulas, functions can be copied to adjacent cells. Simply select the cell that contains the function, then
click and drag the fill handle over the cells you want to fill. The function will be copied, and values for those
cells will be calculated relative to their rows or columns.
Microsoft Excel Training - Functions 16
ACTIVITY