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?
Transcript
1.
Exploring Microsoft Office
Excel 2010
by Robert Grauer, Keith Mulbery,
and Mary Anne Poatsy
Chapter 2
Formulas and Functions
1
2.
Objectives
Use semi-selection to create a formula
Use relative, absolute, and mixed cell references
2
in formulas
Avoid circular references
Insert a function
Total values with the SUM function
Insert basic statistical functions
3.
Objectives (continued)
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
3
4.
Using Semi-Selection to Create a
Formula
Semi-selection uses the mouse pointer to build a
formula containing cell references or ranges
This technique is also called pointing
4
5.
Cell References
Excel offers three types of cell references for use
when a formula is copied
Absolute
$A$1
Relative A1
Mixed
$A1 or A$1
$ indicates that the row number or column letter will
not be modified during a copy
5
6.
Relative Cell References
When the formula shown in the formula bar is
copied, relative address A8 is modified
6
7.
Absolute Cell References
When the formula shown in the formula bar is
copied, absolute address $B$5 is fixed
7
8.
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
8
9.
Avoiding Circular References
A circular reference error occurs if a formula
refers to itself
9
10.
Function Basics
An Excel function is a predefined formula that
performs a calculation
Category
Compatibility
Contains functions compatible with Excel 2007 and
earlier.
Cube
Returns values based on data in a cube, such as
validating membership or returning a member’s
ranking.
Database
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
10
Description
Provides methods for manipulating date and time
values.
11.
Function Basics (continued)
Category
Engineering
Calculates values commonly used by engineers, such as
conversions.
Financial
Performs financial calculations, such as payments, rates and
present/future values.
Information
Provides information about the contents of a cell, typically
displaying TRUE if the cell contains a particular data type, such
as a value.
Logical
Performs logical tests and returns the value of the tests.
Includes logical operators such as AND, OR, and NOT.
Lookup &
Reference
Looks up values, creates links to cells, or provides references to
cells in a worksheet.
Math & Trig
Performs standard math and trigonometry calculations.
Statistical
11
Description
Performs statistical calculations, such as averages or standard
deviation.
Text
Manipulates text strings, by combining words or converting
cases.
12.
Function Terminology
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
parentheses
Example: =SUM(A1:A3)
12
13.
Inserting a Function
When a function is typed, Formula
AutoComplete displays a list of functions
matching the partial entry
13
14.
Inserting a Function
A function ScreenTip is a small pop-up
description that displays the function arguments
14
15.
Insert Function Dialog Box
Use the Insert Function dialog box to search for
a function or select one from a list
15
16.
Function Arguments Dialog Box
The Function Arguments dialog box offers help
on each argument
16
17.
Totaling Values with SUM
The SUM function returns the mathematical sum
of some number of cells or ranges; for example:
=SUM(A1:A3)
=SUM(A1,B3,C5)
=SUM(A1:B3,C5:E8)
17
18.
Basic Statistical Functions
Common statistical functions include:
AVERAGE
arithmetic mean
MEDIAN
midpoint value
MIN
minimum value
MAX
maximum value
COUNT
number of values in range
COUNTA
number of nonempty cells
COUNTBLANK number of empty cells
18
20.
Other Math & Trig Functions
Function Syntax
Description
=ABS(number)
Displays the positive value of a number.
=FREQUENCY(data_ar Counts how often values appear in a given
ray,
range.
bins_array)
=INT(number)
=MODE.SNGL(num1,
[num2],…)
Displays the most frequently occurring value in
a list.
=PI()
Returns the value of pi accurate to 15 digits.
=PRODUCT(num1,
[num2],…)
Multiplies all values within the argument list.
=RANDBETWEEN(bott
om, top)
20
Rounds a value down to the nearest whole
number.
Generates a random number between two
values.
21.
Other Math & Trig Functions
Function Syntax
=RANK.AVG(number,
ref,[order])
Identifies a value’s rank within a list; returns
average rank for identical values.
=RANK.EQ(number,
ref,[order])
Identifies a value’s rank within a list; the top
rank is identified for identical values.
=ROUND(number,
num_digits)
Rounds a value to a specific number of digits.
=SUMPRODUCT(arra
y1,
[array2],…)
Finds the result of multiplying values in one
range by related values in another column and
adding products.
=TRIMMEAN(array,
percent)
Returns the average of the internal values in a
range by excluding a specified percentage at
the upper and lower ends.
=TRUNC(number,
num_digits)
21
Description
Returns the integer equivalent of a number by
truncating the fractional part.
22.
Date Functions
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
time
22
23.
Making Decisions with the IF
Function
=IF(logical_test, value_if_true,value_if_false)
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
23
25.
Designing the Logical Test
The logical test is built from the logical operators
Operator
=
Equal to
<>
Not equal to
<
Less than
>
Greater than
<=
Less than or equal to
>=
25
Description
Greater than or equal to
26.
Using Functions as Arguments
A nested function occurs when one function is
embedded as an argument to another function;
for example:
=IF(A1<A2,MIN(B1:B5),MAX(B1:B5))
Compute the MIN function if A1 is less than A2
Compute the MAX function if A1 is not less than A2
26
27.
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
Range
90-100
A
80-89
B
70-79
C
60-69
D
Below 60
27
Grade
F
28.
Creating a Lookup Table
When searching a range, the breakpoint is the
lowest value
A lookup table typically lists breakpoints in one
column and return values in a second column
Range
0
F
60
D
70
C
80
B
90
28
Grade
A
29.
VLOOKUP Function
The VLOOKUP function searches a lookup table
for a value and returns the result from the related
column
VLOOKUP has three required arguments:
Lookup value
Table array (range of lookup table)
Column index of return value
29
31.
HLOOKUP Function
The HLOOKUP function is used when the
breakpoints and return data are placed in rows
The third argument now lists the row index
0
70
80
90
F
31
60
D
C
B
A
32.
Calculating Payments with the PMT
Function
The PMT financial function calculates the periodic
payment for a loan with a fixed interest rate and
term length
PMT has three required arguments:
Interest rate
Number of periods
Present value (amount of loan)
32
34.
Range Names
A range name is a word or phrase used to
identify a cell or cell range
Range names make formulas easier to read
34
35.
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
35
36.
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
36
37.
Maintaining Range Names
Use the Name Manager dialog box to edit or
delete a range name
37
38.
Summary
In this chapter, you have learned to write formulas
using relative, absolute, and mixed cell
references.
You have learned about statistical and date
functions, such as SUM, AVERAGE, and TODAY.
You have explored the IF, VLOOKUP, and PMT
functions.
You learned to create and use range names.
38
Be the first to comment