Download presentation
Presentation is loading. Please wait.
Published byมะลิ รักไทย Modified over 5 years ago
1
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
Exploring Microsoft Office Excel 2010 by Robert Grauer, Keith Mulbery, and Mary Anne Poatsy Chapter 2 Formulas and Functions This chapter reviews how to perform quantitative analysis, focusing on formulas and functions. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
2
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
Objectives Use semi-selection to create a formula Use relative, absolute, and mixed cell references in formulas Avoid circular references Insert a function Total values with the SUM function Insert basic statistical 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 function Total values with the SUM function Insert basic statistical functions Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
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 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 Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
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 To use semi-selection to create the formula, take the following steps. Assume you want to create a formula such as =A1+A2. Click the cell where you want to create the formula. Type an equal sign (=). Click cell A1. Type a plus sign (+). Click cell A2. Press Enter to complete the formula. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
5
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
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 Excel offers three types of cell references for use when a formula is copied. An absolute cell reference (for example, $A$1) indicates that the address will be fixed and will not be altered during a copy operation. A relative reference (for example, A1) indicates that the address will be adjusted relative to its new location. A mixed reference (for example, $A1 or A$1) has one part that is absolute and the other relative. The F4 key can be used to toggle through the four types of cell references. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall. .
6
Relative Cell References
When the formula shown in the formula bar is copied, relative address A8 is modified 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 Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
7
Absolute Cell References
When the formula shown in the formula bar is copied, absolute address $B$5 is fixed 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 Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
8
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
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 A mixed cell reference contains a fixed column and relative row or a fixed row and a relative column. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
9
Avoiding Circular References
A circular reference error occurs if a formula refers to itself 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. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
10
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
Function Basics An Excel function is a predefined formula that performs a calculation Category Description 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 Provides methods for manipulating date and time values. An Excel function is a predefined formula available in many categories. Function categories and their descriptions are listed in Table Some categories include Compatibility, Cube, Database, and Date & Time. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
11
Function Basics (continued)
Category Description 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 Performs statistical calculations, such as averages or standard deviation. Text Manipulates text strings, by combining words or converting cases. Additional function categories shown in Table 2.1 include Engineering, Financial, Information, Logical, Lookup, Math & Trig, Statistical and Text. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
12
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
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) 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. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
13
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
Inserting a Function When a function is typed, Formula AutoComplete displays a list of functions matching the partial entry 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. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
14
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
Inserting a Function A function ScreenTip is a small pop-up description that displays the function arguments 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. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
15
Insert Function Dialog Box
Use the Insert Function dialog box to search for a function or select one from a list 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. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
16
Function Arguments Dialog Box
The Function Arguments dialog box offers help on each argument 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. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
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) 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 E8 Do 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. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
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 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. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
19
Basic Statistical Functions
See Figure 2.12 for a display of the basic statistical functions. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
20
Other Math & Trig Functions
Function Syntax Description =ABS(number) Displays the positive value of a number. =FREQUENCY(data_array, bins_array) Counts how often values appear in a given range. =INT(number) Rounds a value down to the nearest whole 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, Multiplies all values within the argument list. =RANDBETWEEN(bottom, top) Generates a random number between two values. 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. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
21
Other Math & Trig Functions
Function Syntax Description =RANK.AVG(number, ref,[order]) Identifies a value’s rank within a list; returns average rank for identical values. =RANK.EQ(number, 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(array1, [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) Returns the integer equivalent of a number by truncating the fractional part. 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. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
22
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
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 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. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
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 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. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
24
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
Using the IF Function Figure 2.18 illustrates several examples of IF functions and their results. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
25
Designing the Logical Test
The logical test is built from the logical operators Operator Description = Equal to <> Not equal to < Less than > Greater than <= Less than or equal to >= Greater than or equal to 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”. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
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 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)) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
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 Grade 90-100 A 80-89 B 70-79 C 60-69 D Below 60 F 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. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
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 Grade F 60 D 70 C 80 B 90 A 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 , 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. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
29
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
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 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. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
30
Using the VLOOKUP Function
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. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
31
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
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 60 70 80 90 F D C B A Table 2.6 illustrates a lookup table for the HLOOKUP function. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
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) 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. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
33
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
Using the PMT Function 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. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
34
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
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 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. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
35
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
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 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. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
36
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
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 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. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
37
Maintaining Range Names
Use the Name Manager dialog box to edit or delete a range name 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. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
38
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
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. 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. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
39
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
Questions Are there any questions? Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
40
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. Printed in the United States of America. Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.