This chapter reviews how to perform quantitative analysis, focusing on formulas and functions.
The objectives of Chapter 2 include to: Use semi-selection to create a formula Use relative, absolute, and mixed cell references in formulas Avoid circular references Insert a functionTotal values with the SUM function Insert basic statistical functions
Additional objectives include to: Use date functions Determine results with the IF function Use lookup functions Calculate payments with the PMT function Create and maintain range names Use range names in formulas
Figure 2.1 in the textbook illustrates formulas using relative cell references. The house cost in column A differs for each row and should be altered during a copy operation. So, for example, when the formula =A8*$B$5 is copied from row 8 to row 9, the formula become =A9*$B$5
Again, in Figure 2.1, the textbook illustrates a formula with an absolute cell reference. The down payment rate in cell B5 is the same for each row and should not be altered during a copy operation. For example, when the formula =A8*$B$5 is copied from row 8 to row 9, the formula become =A9*$B$5
A mixed cell reference contains a fixed column and relative row or a fixed row and a relative column.
A circular reference would occur if the formula written in cell C8 is =A8-C8. Since the formula is self-referential and cannot be evaluated, the error message in Figure 2.2 will appear. Excel displays a green triangle in the top-left corner of a cell if it detects a potential error in a formula.
An Excel function is a predefined formula available in many categories. Function categories and their descriptions are listed in Table 2.1. Some categories include Compatibility, Cube, Database, and Date & Time.
Additional function categories shown in Table 2.1 include Engineering, Financial, Information, Logical, Lookup, Math & Trig, Statistical and Text.
The function =SUM(A1:A3) exhibits correct syntax and is well-formed. The function begins with an equal sign (=), then lists the function name (SUM). The argument or input to this function is a range of cells (A1:A3). This function returns the mathematical sum of values in the range A1 to A3.
Excel offers several techniques with which to enter a function. As you type, the Formula AutoComplete option lists all of the names that match the partial entry. In Figure 2.8, a list of functions beginning with letters =SU appears.
A function ScreenTip will appear with each function argument boldfaced. In Figure 2.9, the argument number of the SUM function is boldfaced indicating that a number, cell address, or range is expected.
The Insert Function dialog box can be used to search for a function for which you do not know the name or to select one from a category list. Figure 2.10 illustrates use of the Insert Function dialog box.
Once a function is selected, the Function Arguments dialog box opens with information on each argument syntax. Figure 2.11 illustrates the Function Arguments dialog box.
The SUM function returns the mathematical sum of some number of cells or ranges. Multiple cells or ranges are separated by a comma (,). Examples include: =SUM(A1:A3), which returns the sum of values in the range A1 to A3 =SUM(A1,B3,C5), which returns the sum of values in the three cells A1, B3, and C5 =SUM(A1:B3,C5:E8), which returns the sum of values in the range A1 to B3 and C5 to E8Do not use a formula as an argument in this case. For example, =SUM(A1+A2) computes the addition of A1 and A2, and then returns the sum of that one value. It is a misuse of the SUM function.
Common statistical functions include the following: AVERAGE returns the average or arithmetic mean of a range. MEDIAN returns the midpoint value, halfway between the lowest and highest value in a range. MIN returns the smallest or minimum value in a range. MAX returns the largest or maximum value in a range. COUNT returns the number of numeric values in a range. COUNTA returns the number of nonempty cells in a range. COUNTBLANK returns the number of empty cells in a range.
See Figure 2.12 for a display of the basic statistical functions.
See Table 2.2 for a list of other mathematical and statistical functions. These include: ABS, which returns the absolute value of a number. FREQUENCY, which counts how often a value appears in a range. INT, which rounds a value down to the nearest whole number. MODE.SNGL, which displays the most frequently occurring value in a list. PI, which returns the value of mathematical pi to 15 digits. PRODUCT, which multiples all values in the argument list. RANDBETWEEN, which generates a random number between the low and high arguments.
More mathematical and statistical functions in Table 2.2 include the following: RANK.AVG, which identifies a value’s rank within a list of values, where the average rank is returned for identical values. RANK.EQ, which identifies a value’s rank within a list of values, where the top rank is returned for identical values. ROUND, which returns the value rounded to some number of digits. SUMPRODUCT, which finds the product of multiplying values in one range by related values in another column and then adding products. TRIMMEAN, which returns the arithmetic mean of values in a range after excluding some percentage from upper and lower ends. TRUNC, which returns the integer equivalent of a number after removing the fractional component.
Since dates are numeric, calculations can be performed, such as subtraction. This is useful, for example, to compute the number of days that have passed between two dates. The =TODAY( ) function displays the current date. Although the function has no arguments, empty parentheses are required. The =NOW( ) function displays the current date and time.
The IF function enables a worksheet to display different results depending on a logical condition. For example, the IF function could be used to evaluate whether an employee has met a sales quota and display a bonus of either $500 or $0. The IF function has three arguments including the logical test, result if the condition is true, and result if the condition is false.
Figure 2.18 illustrates several examples of IF functions and their results.
The logical test is typically a binary expression, meaning that it requires a comparison between two variables, such as the values stored in cells A2 and A3.See Table 2.3 for a list of logical operators. For example, the logical test A2=A3 returns true if the two cells have the same content. If text is used in a logical test, it must be enclosed in quotes. The logical test B5=“Yes” compares the content of cell B5 to the word “Yes”.
It is possible to use one function as an argument to another, in a nested fashion. Examples of nested functions are:=IF(A1<A2,MIN(B1:B5),MAX(B1:B5))=IF(C4*2=D4*3,SUM(C4:D4),AVERAGE(C4:D4))
Excel offers a number of Lookup functions in which a table is searched for a value and corresponding data is returned. In the grading scale table shown in Table 2.4, the teacher might look up an average of 75 and determine that the matching grade is C.
The lookup table shown in Table 2.5 lists the breakpoints for the grade ranges in the first column. Each breakpoint is the low end of the range; for example, in the range 90-100, value 90 is the breakpoint. Breakpoints are listed in ascending order.The second column of the table lists the result or the value associated with each range.
The VLOOKUP function is passed a value to look up, the range of the lookup table, and the column number containing the return value. For example, =VLOOKUP(A1,$B$4:$C$8,2) requests that value A1 be looked up in the table extending from B4 through C8. The function then returns the corresponding value in the second column. If there is not an exact match with the value in the first column, Excel uses the row before the first breakpoint that is larger than the value.
Figure 2.19 illustrates the VLOOKUP function in cell F3 to be used to compute grades. The grade to be looked up is E3. This is a relative cell reference, so it can be altered when the formula is copied to successive rows. The table array uses range $A$3:$B$7. It uses an absolute range, so it is not altered when the formula is copied. The column index is 2, requesting that the function return value is to be obtained from the second column of the table.
Table 2.6 illustrates a lookup table for the HLOOKUP function.
The financial function PMT can be used to compute a payment on a loan amount given a fixed interest rate and payment periods. It is important that all terms use the same time units. Given a monthly interest rate and the number of months, PMT will compute a monthly payment. You may need to divide an annual interest rate by 12 to obtain a monthly rate. You may need to multiply the number of years by 12 to produce the number of months. The result of the PMT function is a negative value. You can negate the present value to return a positive value.
Figure 2.20 illustrates use of the PMT function in a car loan worksheet.It returns the monthly payment based upon a monthly interest rate stored in B6, the number of months stored in B8, and the loan amount stored in B3.
Range names can be used to provide user-friendly names for cells or cell ranges. The range name can be used in a formula instead of the cell reference.For example, assume cell A1 stores hours worked and cell A2 stores an hourly pay rate. The formula =A1*A2 could be used to compute pay. If cell A1 was named Hours and cell A2 was named Rate, the same formula could be written =Hours*Rate.
A correct range name must follow several rules. The length can be no longer than 255 characters, and the name must begin with a letter or underscore character.Valid characters within the name include upper- or lowercase letters, digits, periods, or underscores. Blanks or other punctuation are not allowed.
A range name can be entered manually into the Name Box area after selecting the affected cells. Alternatively, Figure 2.24 illustrates use of the New Name dialog box available from the Define Name command in the Defined Names group on the Formulas tab.
Once a range name has been created, it can be edited or deleted. Figure 2.26 illustrates use of the Name Manager dialog box available from the Defined Names group on the Formulas tab. If a range name is altered, Excel automatically adjusts all formulas using the name. If a range name is deleted, formulas that used the range are marked as invalid with the #NAME? error message.
Chapter 2 has studied the use of Excel formulas and functions. You can use relative, absolute, and mixed cell references to create a formula that is easily copied to other locations. You can use statistical and date functions such as SUM, AVERAGE, and TODAY. You have also explored the IF, VLOOKUP, and PMT functions. Finally, you learned to create and use range names.
Are there any questions?
MIS 226: Chapter 2
Exploring Microsoft Office
by Robert Grauer, Keith Mulbery,
and Mary Anne Poatsy
Formulas and Functions
Use semi-selection to create a formula
Use relative, absolute, and mixed cell references
Avoid circular references
Insert a function
Total values with the SUM function
Insert basic statistical functions
Use date functions
Determine results with the IF function
Use lookup functions
Calculate payments with the PMT function
Create and maintain range names
Use range names in formulas
Using Semi-Selection to Create a
Semi-selection uses the mouse pointer to build a
formula containing cell references or ranges
This technique is also called pointing
Excel offers three types of cell references for use
when a formula is copied
$A1 or A$1
$ indicates that the row number or column letter will
not be modified during a copy
Relative Cell References
When the formula shown in the formula bar is
copied, relative address A8 is modified
Absolute Cell References
When the formula shown in the formula bar is
copied, absolute address $B$5 is fixed
Mixed Cell References
In mixed reference $A1, the column is fixed, but
the row may be altered during a copy
In mixed reference A$1, the row is fixed, but the
column may be altered during a copy
Avoiding Circular References
A circular reference error occurs if a formula
refers to itself
An Excel function is a predefined formula that
performs a calculation
Contains functions compatible with Excel 2007 and
Returns values based on data in a cube, such as
validating membership or returning a member’s
Analyzes records stored in a database format in
Excel and returns key values, such as the number of
records or averages value in a field.
Date & Time
Provides methods for manipulating date and time
Function Basics (continued)
Calculates values commonly used by engineers, such as
Performs financial calculations, such as payments, rates and
Provides information about the contents of a cell, typically
displaying TRUE if the cell contains a particular data type, such
as a value.
Performs logical tests and returns the value of the tests.
Includes logical operators such as AND, OR, and NOT.
Looks up values, creates links to cells, or provides references to
cells in a worksheet.
Math & Trig
Performs standard math and trigonometry calculations.
Performs statistical calculations, such as averages or standard
Manipulates text strings, by combining words or converting
Syntax is the set of rules that govern correct
formation of a function
An argument is an input, such as a cell or range
A function begins with the equal sign (=) followed
by the function name and arguments in
Inserting a Function
When a function is typed, Formula
AutoComplete displays a list of functions
matching the partial entry
Inserting a Function
A function ScreenTip is a small pop-up
description that displays the function arguments
Insert Function Dialog Box
Use the Insert Function dialog box to search for
a function or select one from a list
Function Arguments Dialog Box
The Function Arguments dialog box offers help
on each argument
Totaling Values with SUM
The SUM function returns the mathematical sum
of some number of cells or ranges; for example:
Basic Statistical Functions
Common statistical functions include:
number of values in range
number of nonempty cells
COUNTBLANK number of empty cells
Other Math & Trig Functions
Displays the positive value of a number.
=FREQUENCY(data_ar Counts how often values appear in a given
Displays the most frequently occurring value in
Returns the value of pi accurate to 15 digits.
Multiplies all values within the argument list.
Rounds a value down to the nearest whole
Generates a random number between two
Other Math & Trig Functions
Identifies a value’s rank within a list; returns
average rank for identical values.
Identifies a value’s rank within a list; the top
rank is identified for identical values.
Rounds a value to a specific number of digits.
Finds the result of multiplying values in one
range by related values in another column and
Returns the average of the internal values in a
range by excluding a specified percentage at
the upper and lower ends.
Returns the integer equivalent of a number by
truncating the fractional part.
Since dates are numeric, calculations can be
performed, such as subtraction
The TODAY function displays the current date
The NOW function displays the current date and
Making Decisions with the IF
The IF function has three arguments:
A logical test or condition that is true or false
The resulting value if the condition is true
The resulting value if the condition is false
Designing the Logical Test
The logical test is built from the logical operators
Not equal to
Less than or equal to
Greater than or equal to
Using Functions as Arguments
A nested function occurs when one function is
embedded as an argument to another function;
Compute the MIN function if A1 is less than A2
Compute the MAX function if A1 is not less than A2
Using Lookup Functions
Lookup functions are used to look up values in a
table to perform calculations or display results
For example, a teacher may want to look up an
average in order to assign a grade
Creating a Lookup Table
When searching a range, the breakpoint is the
A lookup table typically lists breakpoints in one
column and return values in a second column
The VLOOKUP function searches a lookup table
for a value and returns the result from the related
VLOOKUP has three required arguments:
Table array (range of lookup table)
Column index of return value
The HLOOKUP function is used when the
breakpoints and return data are placed in rows
The third argument now lists the row index
Calculating Payments with the PMT
The PMT financial function calculates the periodic
payment for a loan with a fixed interest rate and
PMT has three required arguments:
Number of periods
Present value (amount of loan)
A range name is a word or phrase used to
identify a cell or cell range
Range names make formulas easier to read
Range Name Rules
Range names use the following rules:
1to 255 characters
Begin with a letter or underscore (_)
Contain letters, digits, period, underscore
Valid names include Rate, Tax_Rate, Rate_2012
Creating a Range Name
Excel offers a variety of methods to enter a range
name after selecting the cells:
Type the range name in the Name Box area
Enter the name using New Name dialog box
Maintaining Range Names
Use the Name Manager dialog box to edit or
delete a range name
In this chapter, you have learned to write formulas
using relative, absolute, and mixed cell
You have learned about statistical and date
functions, such as SUM, AVERAGE, and TODAY.
You have explored the IF, VLOOKUP, and PMT
You learned to create and use range names.