A function is a preset formula that can be used instead of entering a more cumbersome formula. A simple example is the frequently used SUM function. It is very useful when there is a long list of values to add. For example, instead of entering the formula use the SUM function:
=B1+B2+B3+B4+B5+B6+B7+B8+B9 =SUM(B1:B9)
The SUM function is a command that, in the example above, would add all the values of the cells from B1 to B9.
Most spreadsheet programs have a series of built-in functions that help us work with or analyse data quickly and easily. For example, we can find the average of a series of figures, or the maximum or minimum of these figures. Or we can determine an entry dependent on other results using the ‘IF’ function.
Each function uses a similar format called syntax. The formula =B1+B2+B3+B5 +B6+B7+B9 would be written as:
Arguments are often cell references; however, arguments can also be numbers, text, true or false, arrays, or error values as well. The argument can also be a formula or another function that returns a value.
Statistical functions are probably the most commonly used functions. They are used to analyse data in ranges. For example, to find which month had the highest sales one would use the MAX function. The MIN function would be used to display the lowest sales.
In this section you will work with the following functions:
SUM – adds together all values of cells in the range
AVERAGE – calculates the average of all values in the range
MAX – displays the maximum or largest value of the cells in the range
MIN – displays the minimum or smallest value in the range of values.
Open the workbook Split sales downloaded from the above link.
Use the SUM function to find the total sales for the week for each salesperson as shown below in column H.
Now you will use a function to find the total sales and expenses each day. However, this time the cells in the function are not adjacent; for example, on Monday for total sales the values to be added are in cells C4, C10 and C16.
Click on cell C22 and type =SUM(C4,C10,C16), which will sum just the values in those cells.
Repeat to find the total sales for each day.
Click on cell C23 and type =SUM(C5:C7,C11:C13,C17:C19), which will sum just the values in those cell ranges.
Repeat to find the total sales for each day.
In ROW 24, use a function to find the maximum sales for each day of the week.
In ROW 25, use a function to find the minimum sales for each day of the week.
Date and Time functions are used to convert numerical values to date and time values and vice versa.
The TODAY function
The Today function can be used to display the current date on a worksheet. The Today function is one of the few functions that don’t actually have any arguments. It is entered simply as =Today()
The TIME function
The Time function can be used to create a time value that can then be used in calculations. For example when calculating the time spent parking or logged onto the internet. In this exercise you will use the Time function to enable the calculation of time spent logged onto the internet.
Open the data file downloaded from the above link.
The Entry Time and Exit Time are currently entered into separate columns for hours and minutes. The Time function will be used to convert these entries into a time value. The Time function uses three arguments, Hour, Minute and Second. Here there is only a value for the Hour and Minute, so a zero will be entered for the Second. Time (8,40,0) is displayed as 8:40 AM.
Click on D5 and type =TIME(B5, C5, 0) and press <Enter>.
Repeat for D6, D7 and D8 (just for practice).
Copy the formula down the rest of column D and the appropriate cells in Column H. Your worksheet should look as shown below.
Click on cell J5 and enter a simple subtraction formula to calculate the number of hours connected. Copy the formula down the column.