Read these examples of how to use these different spreadsheet functions in the workplace. The learning objectives review how to use each type of function; the tables describe the syntax for each command type in detail.
This section demonstrates using statistical IF functions. Statistical IF functions allow you to evaluate the contents of a cell location before including them in a mathematical calculation. This allows you to selectively include targeted cell locations when executing statistical calculations such as sum, average, count, etc.
The COUNTIF function differs from the regular COUNT function in two ways. First, the regular COUNT function counts only the number of cells in a range that contains numeric data. The COUNTIF function counts the number of cells in a range that contain numeric or text data. Second, the COUNTIF function allows you to selectively count the cells in a range based on specific criteria.
The COUNTIF function contains two arguments: range and criteria. The range argument is defined by the range of cells that will be counted. The criteria argument is defined with the criteria used to decide if a cell in the range should be included in the function's output.
For example, these steps explain how to use the COUNTIF function to calculate the number of investments by investment type on the Portfolio Summary worksheet:
Click the COUNTIF function. This will open the Function Arguments dialog box.
Figure 1 Selecting the COUNTIF Function from the Function Library
Figure 2 Completed Function Arguments Dialog Box for the COUNTIF Function
Figure 3 shows
the results of the COUNTIF function after it is pasted into the range
B5:B7. Because of relative referencing, the cell location used in the criteria
argument is changed after the function is pasted into the range
B5:B7. For example, in cell B6, the function is counting the cell
locations in the range A4:A18, where the contents match the contents of
cell A6. This allows you to use the function to
count the number of investments per investment type. As shown in the
figure, the range B4:B7 now shows the number of investments in this
portfolio by investment type.
Figure 3 COUNTIF Function Output in the Portfolio Summary Worksheet
This text was adapted by Saylor Academy under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License without attribution as requested by the work's original creator or licensor.