46
3244-1 v1.00 © CCI Learning Solutions Inc. 91 Microsoft ® Office Specialist 2010 Microsoft ® Excel ® 2010 Expert Certification Lesson 3: Formulas and Functions Lesson Objectives In this lesson, you will learn about the different types of functions available in Excel for specific calculations, how to activate these functions, and how to apply them. You will also look at different ways of finding and correcting errors in your formulas. Upon successful completion of this lesson, you will be able to: define what a function is use the correct syntax for functions insert a function use mathematical and trigonometric functions use statistical functions use financial functions use logical functions use date and time functions use text functions use information functions use conditional logic and summary functions convert data types use the Error Checking Tool to mark possible incorrect formulas trace formula errors use the evaluate formula feature to debug a formula check the worksheet manually for formula errors For Evaluation Only

Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

  • Upload
    trannhi

  • View
    232

  • Download
    5

Embed Size (px)

Citation preview

Page 1: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

3244-1 v1.00 © CCI Learning Solutions Inc. 91

Microsoft® Office Specialist 2010

Microsoft®

Excel® 2010 Expert Certification

Lesson 3: Formulas and Functions Lesson Objectives In this lesson, you will learn about the different types of functions available in Excel for specific calculations, how to activate these functions, and how to apply them. You will also look at different ways of finding and correcting errors in your formulas. Upon successful completion of this lesson, you will be able to:

define what a function is

use the correct syntax for functions

insert a function

use mathematical and trigonometric functions

use statistical functions

use financial functions

use logical functions

use date and time functions

use text functions

use information functions

use conditional logic and summary functions

convert data types

use the Error Checking Tool to mark possible incorrect formulas

trace formula errors

use the evaluate formula feature to debug a formula

check the worksheet manually for formula errors For E

valu

atio

n Onl

y

Page 2: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Lesson 3 Formulas and Functions

92 3244-1 v1.00 © CCI Learning Solutions Inc.

What are Functions? The power of a spreadsheet program comes from the ability to perform calculations based on entered values. For simple calculations such as ‘A – B =’, the use of common mathematical operators work well. For more complex calculations, such as computing a monthly loan payment amount, Excel spreadsheets offer a tool called a function. Excel has a large selection of built-in functions to help you perform calculations in a spreadsheet.

Built-in functions are grouped into the following categories:

Cube Work with the Microsoft SQL Server Analysis Services tool to perform data mining.

Database Extract and manipulate data within an Excel database.

Date & Time Perform calculations on dates and times.

Engineering Perform calculations that are typically used in engineering applications. Thesefunctions must be loaded as part of the Analysis Toolpak add-in.

Financial Perform financial calculations, such as loans, annuities, and cash flows.

Information Display information about the cells in the worksheet.

Logical Control the actions of the spreadsheet based on evaluations of data in thespreadsheet.

Lookup & Reference Locate information in tables or on the Internet.

Math & Trig Perform mathematical and trigonometric calculations, such as logarithms, cosine,and rounding.

Statistical Perform statistical evaluations, such as average, mean, and standard deviation.

Text Manipulate text strings and convert numbers and text.

Compatibility Use additional functions that are used for workbooks created with Excel 2007 andearlier versions. Any functions in this category will no longer be supported in a laterversion of Excel.

For complete details on the available functions, refer to the Microsoft Excel Help feature or get online help from the Microsoft Web site.

Using the Correct Syntax for Functions When using functions in Excel, you must follow a standard syntax. The basic components of a function consist of the “=” symbol, a function name, and its arguments. The purpose of each of these parts is as follows:

The = Symbol Identifies the start of a formula.

Function Name Identifies the particular function to be used.

(Arguments) Identifies any variable portions of the argument or required parts of the formula.

You put these three components together in the following order:

=FUNCTION(Arguments)

The argument portion of a function is enclosed in parentheses and can be a single or multiple value or reference. Commas separate multiple arguments in a function. Some functions do not require any arguments; these functions do, however, still require parentheses.

2.3 2.4

For E

valu

atio

n Onl

y

Page 3: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Formulas and Functions Lesson 3

3244-1 v1.00 © CCI Learning Solutions Inc. 93

If you do not include the “=” sign, Excel treats the function as a text label. If the function name is invalid, Excel will display #NAME? in the cell. If you do not have the proper number of arguments, Excel displays a message box and suggests using the Insert Function feature to complete building the function.

A function can also be used as part of a larger formula. For example:

=(SUM(A1:A5) + SUM(B1:B7)) / SUM(C1:C3)

In this example, the SUM function is used three times in the same formula. Note the use of brackets to ensure that the calculations are performed in the sequence that you had intended. Excel follows the standard mathematical precedence of operators:

1. Brackets: () 2. Exponents and roots 3. Multiplication and division 4. Addition and subtraction

You can also nest functions together; that is, you can embed one function within another function. An example of nesting functions is the following:

=ROUND(SUM(C1:C5),-2)

You can accomplish the same result by putting the intermediate results into separate cells. In the nested formula example above, you could put the SUM function in cell C6 so the results are displayed there. You can then use =ROUND(C6,-2) to calculate your final result in a different cell.

In Excel 2010, you are permitted to nest up to 64 layers of functions. With earlier versions of Excel, you could only nest up to seven layers.

Inserting Functions Memorizing the syntax of every function is an impossible task. To make it easier to use functions, Excel has a special tool called Insert Function.

To access the Insert Function dialog box, use one of the following methods:

Click Insert Function ( ) to the left of the Formula bar; or

type “=” (to indicate to Excel that you are entering a formula) and then type the first few characters of the function that you want to enter. Excel displays a drop-down list of all functions that begin with these characters; or

on the Home tab, in the Editing group, click the arrow beside AutoSum, then click More Functions; or

on the Formulas tab, in the Function Library group, click Insert Function.

The Insert Function dialog box displays all functions grouped by most recently used or by categories previously discussed. If you do not know the name of the function you want to use, but you do know what you want to accomplish, you can type a brief description of what you want to do and the Insert Function feature will recommend a function for you.

For E

valu

atio

n Onl

y

Page 4: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Lesson 3 Formulas and Functions

94 3244-1 v1.00 © CCI Learning Solutions Inc.

After you select a function, Excel displays the Function Arguments dialog box to help you enter all of the correct values as function arguments. Helpful features of this dialog box include:

Each argument is listed and the required arguments are highlighted in bold. If the function you’re using allows a variable number of arguments, the dialog box displays additional argument boxes as necessary.

When the cursor is in one of the argument text boxes, the relevant help information displays in the lower part of the dialog box.

If you select or enter data values or cell references into the argument boxes, Excel previews the data to the right of that argument box. In the following example screen, the data values being considered are {45;24;57;49;36}.

If enough arguments have been entered, Excel also displays the results in the lower part of the dialog box. In this example screen, the calculated sum for the selected cell range is 211.

Many of the arguments in a function permit you to select a cell or range of cells containing the values to be used. For example, consider the following three functions:

=SUM(45,24,57,49,36)

=SUM(C1,C2,C3,C4,C5)

=SUM(C1:C5)

Assuming that cell C1 contains the value 45, C2 contains 24, and so on, all three of these functions will result in the displayed value of 211.

You can enter a value or cell range into the Function Arguments dialog box directly into the argument text box, in the same way that they have been entered into the Number1 text box in the preceding example screen. If you are entering a cell address reference or a cell range, you can also select this cell range directly from the worksheet. In some situations, such as if you are using a netbook or tablet computer with a very small screen, the Function Arguments dialog box may block your view of the cell range. If you click the Collapse button ( ) located to the right of the argument text box, the Function Arguments dialog box shrinks temporarily, as shown in the following screen example:

Once you have selected your cell range, press or click the Restore ( ) button located at the right side of this text box. The Function Arguments dialog box restores to its full size.

For E

valu

atio

n Onl

y

Page 5: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Formulas and Functions Lesson 3

3244-1 v1.00 © CCI Learning Solutions Inc. 95

1 Create a new blank workbook and save it as Functions – Student.

2 Enter the following values into the worksheet:

Enter a function to total the values in column C and place the answer in cell B1.

3 Select cell B1.

4 Click Insert Function to the left of the Formula bar.

5 If necessary, in the Or select a category box, click the drop-down button and click Most Recently Used.

6 In the Select a function list, click SUM, and then click OK.

For this exercise, you will use the Collapse and Restore buttons to enter argument values into the Function Arguments dialog box. Alternatively, you can enter the cell range values directly into the argument text boxes or select the cell range without collapsing the dialog box.

7 With the cursor in the Number1 box, click Collapse to temporarily shrink the Function Arguments dialog box so that it does not obstruct the cell range to be selected.

8 Select cells C1 to C5 in the worksheet and click Restore to restore the Function Arguments dialog box.

9 Click OK to complete the function.

10 Select cell B2 and then click Insert Function.

11 In the Search for a function box, type: standard deviation and click Go.

Excel displays a list of functions that involve the use of standard deviation. As you select each of these functions, you will see a short description below the text box describing how the selected function works. The STDEV function appears to be the one you are interested in. If you need further help with that function, you can click the hyperlink at the bottom left corner of the dialog box.

12 Click the STDEV function and then click OK to display the Function Arguments dialog box.

13 If necessary, drag the Function Arguments dialog box out of the way so that it is not blocking the cell range C1 to C5.

14 With the cursor in the Number1 box, select the cell range C1 to C5 and click OK.

Your completed worksheet should appear similar to:

15 Save and close the workbook.

Learn the Skill This exercise demonstrates how to use the Insert Function feature.

As the SUM function is by far the most commonly used, it is usually in the Most Recently Used list. If it’s not, you can find it in the Math & Trig category.

For E

valu

atio

n Onl

y

Page 6: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Lesson 3 Formulas and Functions

96 3244-1 v1.00 © CCI Learning Solutions Inc.

Using Math and Trigonometric Functions The most common function in spreadsheet development is the SUM function. Other mathematical and trigonometric functions in Excel include: ABSolute value, COSine, LOGarithm, MODulus, PI, POWER, RADIANS, ROUND, SINe, SQuare RooT, and TANgent.

The intent of this courseware is to teach you basic uses of the functions in Excel, not the mathematics behind them. The following is a list of some common mathematical functions used for general purposes:

SUM Display the total or sum of a range or ranges.

ROUND Round the value to the nearest value with the specified number of decimal places. If thespecified number of decimal places is negative, the number is rounded to the left of thedecimal point.

ROUNDUP Round to the next higher positive value or next lower negative value with the number ofspecified decimal places (similar to the ROUND function).

ROUNDDOWN Round down to the next lower positive value or next higher negative value with thenumber of specified decimal places (similar to the ROUND function).

INT Round the value down to the lower whole number.

TRUNC Use the same way as you would use ROUNDDOWN.

MODULUS Display the remainder from a division calculation.

Note that Excel defines a specific set of arguments for each function. For example, the format of the ROUND function is:

=ROUND(value, num_digits)

In this function, value is the number (or cell address containing the number) you want to round and num_digits is the number of decimals (or cell address containing the number of decimals) you require. If you are not sure, use the Insert Function feature to enter the function correctly.

The ROUND function lets you specify the number of decimal places needed. By default, Excel calculates up to a maximum of 15 digits (on both the left and right sides of the decimal point) regardless of the display format. You may prefer to use formatting to display rounded numbers on the worksheet because this feature does not remove the fractions from subsequent calculations. Note that rounding may adversely affect subsequent calculations because you are actually changing the number, which may cause undesirable effects if the rounded number is used in further calculations.

1 Open the Tour Group Cost workbook and save it as Tour Group Cost – Student.

This worksheet shows the total cost for a group of 26 people on a vacation tour. The total cost needs to be broken down into a cost per person, which will be collected together to pay for the overall tour.

For the first calculation, you will use formatting only without the ROUND function. The result will display as rounded to the nearest whole number.

2 In cell B5, type: =B1/B2 and press .

3 Select cell B5 and, on the Home tab, in the Number group, click Decrease Decimal six times to suppress the display of all digits after the decimal point.

Learn the Skill This exercise will demonstrate how the ROUND function works.

2.3 2.4

For E

valu

atio

n Onl

y

Page 7: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Formulas and Functions Lesson 3

3244-1 v1.00 © CCI Learning Solutions Inc. 97

Now use the ROUND function for the next cell, rounding it to three decimal places.

4 Move to cell B6, type: =ROUND(B1/B2,A6) and press .

Instead of using the value in cell A6, you could have entered the number “3” directly into the ROUND function. Continue with the ROUND function for the remaining cells in column B.

5 In cell B7, type: =ROUND(B1/B2,2).

6 Repeat step 5 for the remaining cell range B8 to B12, using the number in column A as the number of decimal digits for the ROUND function.

Now calculate the total amount by multiplying the calculated result in column B by the number of tour members.

7 In cell C5, type: =B5*$B$2 and press .

8 Copy the formula in cell C5 to C6:C12.

The worksheet should now appear similar to the following:

This worksheet clearly demonstrates the difference between formatting and using the ROUND function. In cell B5, the number appears to be rounded to the nearest whole number. However, the cell still maintains all of the decimal digits as evidenced by the fact that the total calculated cost in cell C5 matches the original total.

In cells B6 to B12, you see a progression of how the rounding function works. Negative numbers will cause rounding to that power of 10; at the extreme end, a “-3” means “10 to the power of -3,” which is 1000; therefore, 3356 would round down to 3000. You can see that, with increased rounding, each calculated total moves further away from the original total group cost, and at a faster rate (i.e., 3000 * 26 = 78,000). Therefore, if you collect $3356 from each person in the tour group, you will be short of the total by only $9.55. But if you collect $3000 from each person, you will be short by $9265.55.

This demonstrates that rounding actually changes the resulting number in that cell.

9 Save and close the workbook.

Using Statistical Functions A spreadsheet is a natural tool for recording statistical data. Excel provides a long list of standard statistical functions to analyze the data, including CONFIDENCE interval, CORRELation coefficient, NORMal DISTribution, POISSON distribution, STandard DEViation, sample VARiance, and more.

Some of the most common statistical functions for general purposes include:

AVERAGE Calculate the mean of the numbers in the list of arguments.

COUNT Count how many cells in the argument list contain values. This function does not count cellswith text or blank cells.

COUNTA Count how many cells in the argument list are not empty. This function counts cells that appearempty from using spaces to clear cells.

MAX Display the largest number in the argument list.

MEDIAN Display the median of the numbers in the argument list.

MIN Display the smallest number in the argument list.

When you enter the first three characters (“=ro”) of this formula, Excel displays a list of all functions that begin with “RO”. Instead of typing the rest of the function name, double-click ROUND in the list. You still have to type in the arguments.

2.4

For E

valu

atio

n Onl

y

Page 8: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Lesson 3 Formulas and Functions

98 3244-1 v1.00 © CCI Learning Solutions Inc.

1 Open the Snow Mountain workbook and save as Snow Mountain – Student.

2 Select cell B13 and, on the Home tab, in the Editing group, click the arrow for AutoSum.

3 Select Count Numbers from the list box.

4 Select the cell range B5:B11 and then press .

5 Enter the following formulas:

Cell Formula B14 =COUNTA(B5:B11) B15 =SUM(B5:B11) B16 =ROUND(AVERAGE(B5:B11),1) B17 =MAX(B5:B11) B18 =MIN(B5:B11) B20 =AVERAGE(B5:I11) B21 =STDEV(B5:I11)

6 Copy the formulas from B13:B18 to C13:I18.

7 Decrease the number of decimals for cells B20 and B21 to one decimal place.

The worksheet should now appear similar to the following:

Notice the different results between the COUNT (row 13) and COUNTA (row 14) in the way they treat cells that contain text characters instead of numbers. Also, notice that the AVERAGE, MIN, and MAX functions ignore cells that do not contain numeric values; for example, in columns B and H, the MIN results are not zero.

8 Save and close the workbook.

Learn the Skill This exercise demonstrates some of the statistical functions in Excel.

You can enter function names and cell references in upper or lower case. You do not have to enter closing parentheses for most functions (except nested functions, as in B16); however, it is a good habit to do so anyway.

For E

valu

atio

n Onl

y

Page 9: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Formulas and Functions Lesson 3

3244-1 v1.00 © CCI Learning Solutions Inc. 99

Using the Subtotal Function The SUM function calculates an arithmetical total of the selected cell range. In most situations, it is the appropriate function for automatically adding together the value in multiple cells.

For complex data tables, it may be more appropriate to use the SUBTOTAL function.

The SUBTOTAL function does more than calculate a sum total for a range of cells; it actually performs a variety of statistical operations, depending on which function number is used. The general format of the SUBTOTAL function is:

=SUBTOTAL(Function #, Cell Range)

The most commonly used function numbers are:

Function # Function 1 AVERAGE—mean average of the cell range 2 COUNT—number of cells containing numbers 3 COUNTA—number of non-blank cells 4 MAX—highest value in the cell range 5 MIN—lowest value in the cell range 9 SUM—sum total of the cell range

Other function numbers that are also available for SUBTOTAL are:

Function # Function 6 PRODUCT (all numbers multiplied together) 7 STDEV.S (standard deviation based on a sample) 8 STDEV.P (standard deviation based on entire population) 10 VAR.S (variance based on a sample) 11 VAR.P (variance based on entire population)

The primary advantage of SUBTOTAL is that it will not include any other SUBTOTAL calculations within its range. As a result, you can insert subtotal, total, and grand total calculations into a table—without any risk of accidentally double-counting a subtotal—by simply including the entire range of cells.

To insert the SUBTOTAL function, use one of the following methods:

Click Insert Function and then, in the Or select a category field, click Math & Trig; or

on the Formulas tab, in the Function Library group, click Math & Trig.

1 Open the Weekly Expense Report workbook and save it as Weekly Expense Report – Student.

First, use the traditional SUM function to calculate the subtotal values in column B.

2 Select cell C6 and then, on the Home tab, in the Editing group, click AutoSum. Verify that only cell C5 is selected as the argument for the SUM function and press .

3 Select cell C9 and then, on the Home tab, in the Editing group, click AutoSum. Verify that only cell C8 is selected as the argument for the SUM function and press .

4 Select cell C13 and then, on the Home tab, in the Editing group, click AutoSum. Verify that both expense values in the cells above are selected and press .

5 Repeat either step 3 or 4 (depending on whether there is one or two values to add together) for each of the remaining subtotal cells in cells C17, C21, C24, E6, E9, E13, E17, E21, and E24.

Learn the Skill This exercise demonstrates the use of the different SUBTOTAL function numbers.

For E

valu

atio

n Onl

y

Page 10: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Lesson 3 Formulas and Functions

100 3244-1 v1.00 © CCI Learning Solutions Inc.

The worksheet should now appear similar to the following:

Up to this point, both columns C and D have been identical; subtotal values have been calculated for each travel office. You will now try to calculate the grand total for all offices.

To do this, you will deliberately create an incorrect grand total for column C, which you will use for comparative purposes.

6 Select cell C25 and then, on the Home tab, in the Editing group, click AutoSum. Select cells C5:C24 and press .

7 Enter the following formulas:

Cell Formula C26 =AVERAGE(C5:C25) C27 =COUNT(C5:C25) C28 =MAX(C5:C25) C29 =MIN(C5:C25)

Now enter the correct formulas for column E; the grand total of =SUM(E6,E9,E13,E17,E21,E24) picks up only the subtotal values.

8 Select cell E25 and then, on the Home tab, in the Editing group, click AutoSum.

To select individual cells instead of the full range as you did in step 6, you must use the key.

9 Select cell E6, hold down the key, and then click on each of cells E9, E13, E17, E21, and E24. Release the key and press .

Notice that the grand total in column E is half of the grand total in column C. This demonstrates that the latter value is double-counting everything in column C.

For E

valu

atio

n Onl

y

Page 11: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Formulas and Functions Lesson 3

3244-1 v1.00 © CCI Learning Solutions Inc. 101

10 Enter the following formulas:

Cell Formula E26 =AVERAGE(E5,E8,E11,E12,E15,E16,E19,E20,E23) E27 =COUNT(E5,E8,E11,E12,E15,E16,E19,E20,E23) E28 =MAX(E5,E8,E11,E12,E15,E16,E19,E20,E23) E29 =MIN(E5,E8,E11,E12,E15,E16,E19,E20,E23)

As you can see, step 10 was painful—it was tedious and error-prone.

The worksheet should now appear similar to the following:

Now use the SUBTOTAL function and see how it works.

11 Select cell G6 and enter: =SUBTOTAL(9,G5).

12 Now enter the remaining subtotal formulas:

Cell Formula G9 =SUBTOTAL(9,G8) G13 =SUBTOTAL(9,G11:G12) G17 =SUBTOTAL(9,G15:G16) G21 =SUBTOTAL(9,G19:G20) G24 =SUBTOTAL(9,G23)

Note that you can select the cell or cell range instead of typing the cell reference addresses into the function, if that is easier for you.

13 Select cell G25 and enter: =SUBTOTAL(9,G5:G24).

Enter the remaining statistical functions using SUBTOTAL.

For step 10, you could save time by using absolute cell references for the AVERAGE formula, copying them to the remaining cells, and changing the function name.

For E

valu

atio

n Onl

y

Page 12: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Lesson 3 Formulas and Functions

102 3244-1 v1.00 © CCI Learning Solutions Inc.

14 Enter the following formulas: Cell Formula

G26 =SUBTOTAL(1,G5:G25) G27 =SUBTOTAL(2,G5:G25) G28 =SUBTOTAL(4,G5:G25) G29 =SUBTOTAL(5,G5:G25)

Step 14 was much easier to do than step 10 because you simply selected the entire cell range in the column (including the grand total). The SUBTOTAL function simply ignored the presence of any other SUBTOTAL function within that cell range. As a result, column G shows the same results as column E. It was just as easy in column C to enter those formulas, but the results were incorrect.

The worksheet should now appear similar to the following:

15 Save and close the workbook.

Working with Financial Functions Several financial functions are built into Excel. These financial calculations have some very complex mathematics underneath, so they are useful in many applications. They are particularly useful when using worksheets that require calculations of loan payments, annuities, and related calculations. Some of the more useful financial functions include:

PMT Calculate the payment required for a given principal, interest rate, and number of time periods.

NPV Calculate the Net Present Value of a stream of cash flows.

PV Calculate the Present Value of an ordinary annuity or series of payments.

FV Calculate the Future Value of an ordinary annuity or series of payments.

2.4 For E

valu

atio

n Onl

y

Page 13: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Formulas and Functions Lesson 3

3244-1 v1.00 © CCI Learning Solutions Inc. 103

As an example, the PMT function requires that you specify the principal (amount borrowed), the interest rate, and the term (repayment period). The function also includes two optional arguments: ending balance (termination/buy out) and type (when payments will be made; enter “0” or leave this blank for the end of the month or enter “1” for the beginning of the month). The format is:

=PMT(interest,term,principal,ending balance,type)

When you enter the values for interest and term, ensure that you express them in the same time units. For example, if you want to find the monthly loan payment, you must ensure that both interest and term are expressed in months. If you are given an annual interest rate, you must divide that value by 12. And if the term is in years, you must multiply that value by 12.

For example, to calculate the monthly payment for a loan with an annual interest rate of 6% and a term life of five years, the arguments used in the PMT function are:

interest rate = 6% / 12 = 0.5% per month

term = 5 x 12 = 60 months

Note: The PMT function cannot be used to correctly calculate mortgage payments in some countries, such as Canada, where interest on residential mortgages is calculated semi-annually, not in advance. As a result, the monthly payment amount is lower because the interest is not compounded monthly. The PMT function does correctly calculate the mortgage payments in other countries that do not have this rule, such as the United States.

In general, Excel calculates the Total per Term by using the number of monthly payments multiplied by the amount of the monthly payment. The Total Interest paid is based on the Total per Term minus the amount of the Loan.

A loan analysis table enables you to see the amount of principal and interest that is paid on a loan monthly or yearly. Once completed, the spreadsheet can be used to quickly determine the payments required for any loan amount, interest rate, and term.

1 Open the Monthly Payments workbook and save it as Monthly Payments –Student workbook.

2 Use the following data for the loan payment calculation: Amount of Loan (B1) 5,000 Interest Rate (B2) .06 Term of Loan (B3) 12 Ending Balance (B4) 0 Payment Type (B5) 0 Payment/Month (B7) =PMT(B2/12,B3,‐B1,B4,B5) 

Total/Term (B8) =B7*B3 Total Interest (B9) =B8‐B1 

Note that the interest rate used here is for a full year, but the term is in months. The interest rate must be converted into a monthly rate. The loan will be fully paid off at the end of the term, so the ending balance will be zero.

3 Select cells B12:E23. On the Home tab, in the Number group, click the arrow for Number Format, and click Currency.

4 In cell B12, type: =B1 to represent the initial loan amount.

5 In cell C12, type: =B12*$B$2/12.

Learn the Skill This exercise demonstrates the use of the PMT function on a loan used to pay for vacation travel.

Because the Ending Balance and Payment Type values are both zero, the last two arguments of the function could be omitted, in this case. Fo

r Eva

luat

ion

Only

Page 14: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Lesson 3 Formulas and Functions

104 3244-1 v1.00 © CCI Learning Solutions Inc.

This will show the amount of interest to be paid in the first month. You will be copying this formula, so you will have to make the entry in the Interest Rate cell into an absolute cell reference.

6 In cell D12, type: =$B$7‐C12 as the formula to subtract the interest paid from the Monthly Payment.

Note that you must make the formula in cell B7 absolute because you will be copying this formula.

7 In cell E12, type: =B12‐D12 to calculate the Beginning Principal less the Principal paid for the current month.

Complete the table by following these steps.

8 In cell B13, type: =E12 to represent the Ending Balance of the first month.

9 Copy the range of cells C12:E12 to cells C13:E13.

10 Copy the range of cells B13:E13 to cells B14:E23.

The worksheet should now appear similar to the following:

Note that the ending balance in cell E23 is $0.00.

11 Save and close the workbook.

Using Logical Functions One of the most powerful and useful features of spreadsheets is the ability to perform calculations that depend on a condition that will become true. The primary function used for this is the IF function. This function makes an evaluation or logical test and performs one of two functions based on the result. This automatic evaluation provides on-the-fly worksheet calculations.

The format of the IF function is as follows:

=IF(logical test,value if true,value if false)

Logical Test This specifies what the IF statement will evaluate.

Value if True If the Logical Test is found to be true, the result of the IF function will be whatever is in thissection of the formula.

Value if False If the Logical Test is found to be false, the result of the IF function will be whatever is in this section of the formula.

For E

valu

atio

n Onl

y

Page 15: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Formulas and Functions Lesson 3

3244-1 v1.00 © CCI Learning Solutions Inc. 105

The Logical Test section of the statement can include comparison operators that will help you obtain the desired result. Qualifiers are punctuation marks used to identify or define different types of data; for example, text used in a formula requires double quotes as qualifiers. Qualifiers also enable you to evaluate for a range of numbers or results.

Some of the comparison operators you can use are:

= Equal to (or the same as) > Greater than < Less than >= Greater than or equal to <= Less than or equal to <> Not equal to

The Value if True/False sections can contain a text string, values, or other functions. In fact, you can nest or embed up to 64 IF functions within one IF statement. An example of a nested IF function would look as follows:

=IF(A1=10, “text A”,IF(A1=20, “text B”, “text C”))

In this example, the following values will be displayed when the conditions are met:

If A1 contains Then this will display 10 text A 20 text B Any other value text C

Two additional functions combine the power of the IF function with the COUNT and SUM functions:

COUNTIF For the selected range of cells, include only those cells in which the logical test value will have aresult that is true in the count.

SUMIF For the selected range of cells, include only those cells in which the logical test value will have aresult that is true in the sum.

There are more conditional statistical functions, but these two are the most commonly used ones of that type.

Tolano Adventures offers a promotional rebate program for customers who spend over $10,000 during the year. You will use a worksheet that will calculate the rebate at 2% of the amount spent over $10,000. There is no rebate if the amount is less than $10,000.

1 Open the Customer Sales Rebate workbook and save it as Customer Sales Rebate –Student.

2 Select cell D2 and click Insert Function

3 In the Or select a category list, click Logical.

4 In the Select a function list, click IF and click OK.

As the rebate only applies to amounts in excess of $10,000, the logical test will evaluate the sales value in the adjacent cell (C2) and determine if this amount is in excess of $10,000.

5 In the Logical_test field, type: C2>10000.

The next section is the Value_if_true section. If the value in the cell on the left (C2 in this case) is in excess of 10,000, you want the function to calculate the rebate as 2% of the sales amount.

6 In the Value_if_true field, type: C2*0.02.

Learn the Skill This exercise demonstrates the use of the IF function.

For E

valu

atio

n Onl

y

Page 16: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Lesson 3 Formulas and Functions

106 3244-1 v1.00 © CCI Learning Solutions Inc.

The last part of the formula is the Value_if_false section. If the figure to the left is less than or equal to 10,000, you want the function to return a zero.

7 In the Value_if_false field, type: 0.

The Function Arguments dialog box appears as follows:

8 Click OK.

Note that the resulting formula is =IF(C2>10000,C2*0.02,0).

The formula contains a relative cell address (C2); therefore, you can copy the formula into the other parts of the worksheet.

9 Copy the formula from cell D2 to cells D3:D26.

Calculate the total rebates to be paid out to customers.

10 Select cell D27 and, on the Home tab, in the Editing group, click AutoSum; then press to accept it.

The worksheet should now appear similar to the following:

11 Save and close the workbook.

For E

valu

atio

n Onl

y

Page 17: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Formulas and Functions Lesson 3

3244-1 v1.00 © CCI Learning Solutions Inc. 107

You can modify your IF function if you want a more presentable worksheet. For example, if you want the IF formula to show a blank cell instead of zeros or dashes when there is no rebate, modify the formula to appear as follows:

=IF(C2>10000,C2*0.02," ") The double quotes will cause Excel to insert a blank in any cell that proves FALSE based on the argument in the Logical_test.

Another possible alternative would be to display a message:

=IF(C2>10000,C2*0.02,"does not qualify") To have either example work properly, remember to copy the changed formula to the other cells on the worksheet.

Using Date and Time Functions Excel’s date and time functions help you create worksheets that perform calculations based on dates and times. It is possible to use dates to calculate things such as age or length of service or number of days between two dates. The use of time functions enables calculations based on time, with Excel converting seconds to minutes and minutes to hours.

To do these calculations, Excel stores the date and time values as serial numbers with the integer portion being the number of days since January 1, 1900 and the fractional part as a portion of 24 hours. Special functions are provided to determine the date and time serial numbers, and to extract the month, day, year, hours, minutes, and second values from serial numbers.

Some of the most useful date and time functions include:

NOW Return the serial number of the current date and time. This date and time value is continuously updated.

TODAY Return the serial number of today’s date with the time portion set to 0. This date value iscontinuously updated.

DATE Calculate the serial number for a specified date.

DATEVALUE Calculate the serial number for a specified date, which is in general text form.

DAY Display the day value for the specified date serial number.

MONTH Display the numeric month value for the date serial number.

YEAR Display the year value for the specified year serial number.

WEEKDAY Display a numeric weekday value for the date serial number.

HOUR Display the hour value for the specified time serial number.

MINUTE Display the minute value for the specified time serial number.

SECOND Display the second value for the time serial number.

For example, the format for the DATE function is as follows:

=DATE(YEAR,MONTH,DAY)

The format for the =TIME function is as follows:

=TIME(HOUR,MINUTE,SECOND)

A different way of obtaining the current date is by pressing + , and the current time by pressing ++ . However, these date and time values do not change; they always stay as the original values.

When using Insert Function, Excel inserts the quotes for you. If you want the False Value to be blank, you must type both quotes or the word False will appear in the cell.

2.4

For E

valu

atio

n Onl

y

Page 18: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Lesson 3 Formulas and Functions

108 3244-1 v1.00 © CCI Learning Solutions Inc.

1 Open the Departure Date Calculator workbook and save it as Departure Date Calculator – Student.

2 Select cell B3 and enter a date in the future of your choice.

Use a function to obtain the current date and time. It automatically updates itself over time.

3 Select cell B4 and enter: =NOW().

Perform a calculation using dates. These calculations look just like ones using numeric values.

4 Select cell B6 and enter: =B3‐B4. 

Extract the components of today’s date and time value into individual numbers.

5 Enter the following functions:

Cell Formula B8 =MONTH(B4) B9 =DAY(B4) B10 =YEAR(B4) B11 =HOUR(B4) B12 =MINUTE(B4) B13 =SECOND(B4)

Create a new date value using the month, day, and year numbers.

6 Select cell B15 and enter: =DATE(B10,B8,B9). 

The worksheet should now appear similar to the following:

Recalculate the current date and time, and note the changes in cells B12 and B13.

7 Press the key.

8 Save and close the workbook.

Learn the Skill This exercise demonstrates the use of date and time functions.

Even though some of the cells only show two digits of the year value, Excel uses four digits internally to ensure the date calculations are correct.

For E

valu

atio

n Onl

y

Page 19: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Formulas and Functions Lesson 3

3244-1 v1.00 © CCI Learning Solutions Inc. 109

Using Text Functions Excel includes several text-oriented functions that are useful for handling text strings. They are often used to manipulate data imported from other sources. Some of the most useful text functions include:

TEXT Convert a number into the equivalent text string formatted as specified.

TRIM Remove any blanks from the text string.

LEFT Extract the specified number of characters starting from the left side of the text string.

RIGHT Extract the specified number of characters starting from the right side of the text string.

MID Extract the specified number of characters starting from any position in the text string.

LEN Determine the number of characters in a text string.

FIND Search a text string for specified characters, and return the starting position if the charactersare found. The FIND function is case sensitive. The SEARCH function is the same as the FINDfunction but is not case sensitive.

UPPER Convert all characters in a text string to uppercase.

LOWER Convert all characters in a text string to lowercase.

PROPER Convert the first letter of the text string and any letter following a non-alphabetic character to uppercase. All other characters are set to lowercase.

REPLACE Replace text at a specified location in a text string with new text.

REPT Create a text string by repeating the specified characters for the specified number of times.

SUBSTITUTE Replace text of a specific pattern in a text string with new text.

In addition to text functions, strings of text can be joined or concatenated using the & operator. When spreadsheets are used for lists or as a database, these often overlooked functions can save many hours of manually entering data.

1 Create a new, blank workbook.

2 Enter the following values:

Cell Value A1 JaNe B1 pArkER‐smiTh A5 BIRTHDAY

3 Increase the width of columns A, B, and C to 22.

4 Select cell C1 and type: =A1&" "&B1.

The space between the quotation marks is required to separate first and last names.

5 Select cell A2 and type: =LOWER(A1).

6 Select cell A3 and type: =UPPER(A1).

7 Select cell A4 and type: =PROPER(A1).

Learn the Skill This exercise is designed to demonstrate how text functions can be used to change character strings.

2.4

For E

valu

atio

n Onl

y

Page 20: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Lesson 3 Formulas and Functions

110 3244-1 v1.00 © CCI Learning Solutions Inc.

8 Copy cells A2:A4 to B2:C4.

Notice that Excel inserts capitals in all the proper locations, including after the hyphen.

9 In cell A6, type: =LEFT(A5,5).

10 In cell A7, type: =RIGHT(A5,3).

11 In cell A8, type: =LEFT(A5,3)&MID(A5,6,1). 

Use the functions for replacing and substituting text characters to create new words. The REPLACE function substitutes text characters at a starting position for the specified number of characters. The SUBSTITUTE function replaces a specified pattern of text characters with a new set of characters, regardless of where the characters are located.

12 In cell B5, type: =REPLACE(A5,1,5,"SUN"). 

13 In cell C5, type: =SUBSTITUTE(A5,"DAY","STONE").

The worksheet should now appear similar to the following:

14 Save the workbook as Text Functions – Student and close it.

Using Information Functions These functions return a simple true or false condition based on the arguments provided. The information functions can refer to cells or test the results of formulas. When combined with the IF function, the information functions can be used to control a variety of conditional processing tasks. Some commonly used information functions include:

ISBLANK Return a TRUE value if the cell or formula being tested has no entry in it.

ISERROR Return a TRUE value if the referenced cell or function has any kind of error.

ISNA Return a TRUE value if the selected cell or function results in a # N/A error message.

ISNONTEXT Return a TRUE value if the cell or function results contain any value other than text characters,or is blank.

ISTEXT Return a TRUE value if the selected cell contains text-only characters.

ISNUMBER Return a TRUE value if the cell or function results contain a numeric value.

NA Return the # N/A error value. It is often used as part of the logical IF function.

2.3 2.4

For E

valu

atio

n Onl

y

Page 21: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Formulas and Functions Lesson 3

3244-1 v1.00 © CCI Learning Solutions Inc. 111

1 Create a new, blank workbook.

2 Enter the following values:

Cell Value B2 String B3 325.1 B4 Plain A5 10 B5 0

3 Enter the following functions into the cells indicated:

Cell Function C2 =ISNUMBER(B2) D2 =IF(ISNUMBER(B2),"B2 is a number","B2 is not a number") C3 =ISTEXT(B3) C4 =ISNONTEXT(B4) C5 =IF(B5=0,NA(),A5/B5) D5 =IF(ISNA(C5),"Error: Attempt to divide by zero!","") 

The worksheet should now appear similar to the following:

4 Now change the values as follows:

Cell Value B2 15 B3 Variable B4 (delete the value) B5 5

5 If you wish, enter other values of your choosing into cells B2, B3, B4, A5, and B5.

6 Save the workbook as Information Functions – Student and close it.

Using Lookup and Reference Lookup functions are used to find information in lists or arrays based on a known value. This capability is very useful in situations such as locating product information in the form of a table containing product IDs, with the description and price next to each ID. You can scan down the list until you find the Product ID, then easily look at the adjacent columns to find the description and price for that product. That is the basic principle of the lookup functions: look for a value in a table and select the corresponding values in adjacent cells.

Learn the Skill This exercise demonstrates the use of some of the information functions in Excel.

For E

valu

atio

n Onl

y

Page 22: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Lesson 3 Formulas and Functions

112 3244-1 v1.00 © CCI Learning Solutions Inc.

These functions can also be considered as array functions because the data used for lookups are in the form of arrays. In other words, the lookup functions search through a one-dimensional (row or column) or two-dimensional range of cells containing data to extract a value.

The most common lookup and reference functions are:

CHOOSE Select from a one-dimensional list of values (called a vector) by using an index number. This is the simplest form of lookup.

INDEX Select from a two-dimensional list of values.

HLOOKUP Perform a lookup across the first row of a two-dimensional array selecting the column that matches the search value. An index number is used to select the row from which the value will be returned.

VLOOKUP Perform a vertical lookup, in much the same way that HLOOKUP performs a horizontal lookup.

The format for the vertical lookup function is as follows:

=VLOOKUP(lookup value,table array,column index number,range lookup)

Similarly, the format for the horizontal lookup function is as follows:

=HLOOKUP(lookup value,table array,row index number,range lookup)

lookup value The value to be found in the table array.

table array The location or table of information where the data can be found.

column index number

The column used in a specific row to find the item; columns are numbered sequentially fromthe left-most column.

row index number

The row used in that column to find the item; rows are numbered sequentially from the toprow of the table.

range lookup You can enter “0” or “false” if you wish the function to find an exact match in a sorted orunsorted list; enter “true” or “omit argument” if you want the function to find an approximate match in a sorted list.

Even though the range lookup parameter is optional, it has an important switch setting that deserves a closer look. Consider an example of a scoring sheet for a school examination paper:

Mark Achieved on Exam Grade Assigned

0% F 50% D 60% C 70% B 85% A

All students will have a result ranging from 0% to 100%. The VLOOKUP formula would be used here because the data are aligned vertically. By using a range lookup value of TRUE, you tell Excel to search the table for the highest mark value that does not exceed the lookup value. For example, a student achieving a mark of 65% will get a grade value of C because 60% is the highest table value found that does not exceed the lookup value.

If a range lookup value of FALSE is used, the VLOOKUP formula will not find the correct grade for most students. This is because the mark achieved must exactly match one of the values in the table in order to be found. Therefore, a range lookup value of FALSE is not the right choice to use here.

For E

valu

atio

n Onl

y

Page 23: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Formulas and Functions Lesson 3

3244-1 v1.00 © CCI Learning Solutions Inc. 113

If the scoring sheet is structured horizontally, the HLOOKUP formula should be used instead, as follows:

Mark Achieved on Exam 0% 50% 60% 70% 85%

Grade Assigned F D C B A

The same range lookup value of TRUE can be used to find the correct grade to assign, even though the student’s mark can be any value between 0% and 100%. And the range lookup value of FALSE is also inappropriate for this HLOOKUP formula because most students will not have a mark that matches the table values exactly.

1 Open the Pricing Sheet workbook and save it as Pricing Sheet – Student. 

This worksheet shows a partial tour pricing list on the top and a sample invoice below it. The requirement is to enter a product number in column B of the invoice and have the description and cost appear on the invoice automatically. In this case, Excel will look up the product number in an inventory and retrieve the corresponding description and cost.

2 In cell E12, type: =A12*D12 and press .

3 Copy this formula to range E13:E14.

4 In cell E15, type: =SUM(E12:E14) and press .

5 In cell C12, type: =VLOOKUP(B12,$B$5:$D$8,2,TRUE) and press .

The characters #N/A appear in cell C12.

6 Copy this formula to the range C13:C14.

7 In cell D12, type: =VLOOKUP(B12,$B$5:$D$8,3,TRUE) and press .

8 Copy this formula to range D13:D14.

Learn the Skill This exercise is designed to demonstrate the use of the VLOOKUP function in an invoice worksheet.

Notice that the tour numbers are sorted in ascending order. This is required for the lookup function to work properly.

In a real-world example, the inventory list would be on a different worksheet or, more often, in a different workbook. This exercise has been simplified for instructional purposes.

For E

valu

atio

n Onl

y

Page 24: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Lesson 3 Formulas and Functions

114 3244-1 v1.00 © CCI Learning Solutions Inc.

Notice the #N/A filling the cells; this is displayed by the lookup functions when there is no lookup value. The IF function could be used to clean up its appearance, but this exercise focuses on the lookup function.

9 Enter the following quantities and part numbers:

Row Qty Tour# 12 3  A0289 13 4  B3454 14 2 A4350

The worksheet should now appear similar to the following:

The last item entered had the wrong tour number. As a result, the wrong description and cost were displayed. For this kind of worksheet, you should use the FALSE value for the range lookup option so that Excel will identify incorrect tour numbers immediately.

10 Select cell C12, press , and change the TRUE to FALSE in the VLOOKUP formula.

11 Repeat step 10 for cell D12.

12 Copy the formulas in cell C12:D12 to cells C13:D14. For E

valu

atio

n Onl

y

Page 25: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Formulas and Functions Lesson 3

3244-1 v1.00 © CCI Learning Solutions Inc. 115

13 Select cell B14 and enter the correct tour # value: A4353.

The worksheet should now appear similar to the following:

14 Save and close this workbook.

Converting Data Types Several Excel functions are dedicated to changing data from one type to another. In computer systems, data types are very important because all other calculations, operations, and functions expect to work with specific data types. For example, the computer is not able to perform arithmetic with alphabetical characters or use text functions (such as choosing upper case) on numbers or date values.

Suppose you wanted to create the following sentence: “You are <A1> years old,” in which cell A1 contains a person’s age as a number. The first and last halves of the sentence are text strings. You can use the CONCATENATE function to attach multiple text strings together into a single longer one. However, the CONCATENATE function requires every component to be a text string. To insert the age into the middle, you must convert the number into its equivalent text value and then concatenate the three pieces together. The resulting formula would then be:

=CONCATENATE("You are ",TEXT(C2,"0.0")," years old")) For E

valu

atio

n Onl

y

Page 26: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Lesson 3 Formulas and Functions

116 3244-1 v1.00 © CCI Learning Solutions Inc.

The following conversion functions are commonly used:

CHAR Convert a number in the range of 0 to 255 to its equivalent text character.

CODE Convert a text character to its equivalent internal code (the reverse of CHAR). If the argumentis a string containing more than one character, it converts only the first one.

DATEVALUE Convert a text string that contains a date to a date value.

DOLLAR Convert a number to a text string using the local currency format. You can also specify thenumber of digits to show after the decimal point.

FIXED Convert a number to a text string using the standard number format. You can also specify thenumber of digits to show after the decimal point.

TEXT Convert a number to a text string using a custom display format that you also specify.

VALUE Convert a text string containing a number to a numeric value.

1 Open the Conversion Functions workbook and save it as Conversion Functions – Student.

Start with an ordinary number in a cell.

2 Select cell C2 and enter: 12.

Now enter a function that will convert a number into its equivalent text string.

3 Select cell D2 and enter: =TEXT(C2,"0").

You can see that the number in cell C2 is right-aligned, which is the default treatment for numbers, and the text in cell D2 is left-aligned, which is the default for text strings.

Let’s see what happens when we enter arithmetical formulas for both cells.

4 Enter the first row of values or formulas:

Cell Value F2 =C2+10 G2 =D2+10

Surprisingly, Excel has no problem with performing arithmetic on a cell containing a text string.

Now enter the number 12 as a text string. To do so, you must use the single quote as the very first character of the string, which Excel will understand as an instruction to treat the rest of the data entered as a text string. Without that single quote, Excel will automatically convert anything that looks like a proper number to a number, and anything that looks like a date to a date format.

Learn the Skill This exercise demonstrates how to use functions that will convert data values from one type to another.

For E

valu

atio

n Onl

y

Page 27: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Formulas and Functions Lesson 3

3244-1 v1.00 © CCI Learning Solutions Inc. 117

5 Select cell C3 and enter: '12.

Excel displays a smart tag in the upper left corner of this cell to warn you that the value looks like a number but that you have entered it as a text string.

Now enter a conversion function for the next cell to convert it to the equivalent number.

6 Select cell D3 and enter: =VALUE(C3).

Notice the default alignment used in these two cells.

Now copy the arithmetical formulas from the row above.

7 Copy the formulas in F2:G2 down to F3:G3.

For the next set, you will try converting a number to a date value.

8 Select cell C4 and enter: 4194.3595.

9 Select cell D4 and enter: =C4.

Since a date value is really a number (the number of days since January 1, 1900), you only need to change the formatting to a date or date and time format.

10 Select cell D4 again and then, on the Home tab, in the Number group, click the dialog box launcher. In the Format Cells dialog box, select Date under Category (in the Number tab), and click 3/14/01 1:30 PM in the Type list, then click OK.

11 Copy the formulas in F3:G3 down to F4:G4.

For the next set, you will convert a date and time value to a number.

12 Select cell C5 and enter: =NOW(). (You may need to widen column C in order to fully display the date and time.)

13 Select cell D5 and enter: =C5.

14 Copy the formulas in F4:G4 down to F5:G5.

For the next set, you will convert a text string containing a date value to a date.

15 Select cell C6 and enter: 'June 25, 2011.

16 Select cell D6 and enter: =DATEVALUE(C6).

17 Copy the formulas in F5:G5 down to F6:G6.

Excel has again interpreted a cell containing what appears to be a date value and treated it as a date value so that the arithmetic operation could be performed in cell F6.

For the next set, you will convert a number to its equivalent text character, and the reverse.

18 Select cell C7 and enter: 65.

19 Select cell D7 and enter: =CHAR(C7).

20 Select cell C8 and enter: a.

21 Select cell D8 and enter: =CODE(C8).

Notice that the internal code value for “A” is different than for “a”.

22 Copy the formulas in F6:G6 down to F7:G8.

The arithmetical operation in cells G7 and F8 failed because Excel is not able to perform this function with alphabetical characters.

For the next set, you will convert a number to a dollar currency format and a text string format.

For E

valu

atio

n Onl

y

Page 28: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Lesson 3 Formulas and Functions

118 3244-1 v1.00 © CCI Learning Solutions Inc.

23 Select cell C9 and enter: 12345.6789 then enter it into cell C10 as well.

24 Select cell D9 and enter: =DOLLAR(C9,2).

25 Select cell D10 and enter: =FIXED(C10,2,FALSE).

26 Copy the formulas in F8:G8 down to F9:G10.

The worksheet should now appear similar to the following:

27 Save and close the workbook.

Using Advanced Functions Using Conditional Logic Functions

Most Excel functions simply perform their calculations and display the results in the cells in which they are located. Conditional logic functions are useful in situations where you want to perform one of two different calculations, depending on what the value is in one or more cells other than the one in which they are located.

In the IF function (described above in the Using Logical Functions topic), you are permitted to have only one logical test that results in a TRUE or FALSE value. If you need to perform two or more different logic tests, then you must either nest that number of IF functions inside each other, or use an AND or OR function.

AND The AND function allows multiple logical tests to be performed, and all of them are combinedtogether to return a single TRUE or FALSE value. The AND function returns a TRUE value only if all of the logical tests are TRUE. It returns a FALSE value if any of the logical tests result in a FALSE value. AND(logical test 1, logical test 2, ...) You can have up to 255 logical tests in an AND function.

NOT This function returns the logical opposite value of a logical result. That is, a TRUE value is reversed to a FALSE, and a FALSE is reversed to a TRUE. NOT(logical test) You can enter only one logical value in this function.

OR Like the AND function, the OR function evaluates multiple logical tests to return a single TRUE or FALSE value. Unlike the AND function, this function returns a TRUE value if any of the logical tests are TRUE. It returns a FALSE value only if all of the logical tests result in a FALSE value. OR(logical 1, logical 2,...) You can have up to 255 logical tests in an OR function.

When you need to nest logical functions together, be sure to build them slowly, one function at a time. Nested functions are complex: the arguments, commas, and brackets must be in the right place to prevent them from either being rejected by Excel or from returning incorrect results.

Another logical function that you will find useful for special situations is IFERROR:

IFERROR(value, value_if_error)

2.3

For E

valu

atio

n Onl

y

Page 29: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Formulas and Functions Lesson 3

3244-1 v1.00 © CCI Learning Solutions Inc. 119

If the first argument is determined to be an error value, then the value in the second argument is calculated and displayed instead. It is typically used with another function, formula, or cell reference nested inside it as the first argument. For example, suppose you have the following formula in cell A1:

=B1/C1

If cell C1 contained the value 0 (zero), then cell A1 will display #DIV/0 to show that you are trying to divide by zero, which is an error situation. To avoid displaying the #DIV/0, you can change the formula to:

=IFERROR(B1/C1," ")

Then if cell C1 contains a zero, then cell A1 will appear as a friendlier-looking blank cell, otherwise it will show the result of dividing C1 into B1.

The IFERROR function can detect any of the following error conditions:

#N/A (argument error for a function)

#VALUE (incorrect argument type for a function)

#REF! (invalid cell reference)

#DIV/0 (division by zero)

#NUM! (numeric value expected in a function)

#NAME? (function name is spelled incorrectly)

#NULL (null value returned by a function)

1 Open the Pricing Sheet – Student workbook.

2 Select cell B14 and press .

The #N/A identifier is now displayed in several cells, all of which depend on the value appearing in cell B14. Clearly, these error symbols are very distracting on a worksheet, especially since it is difficult to know in advance how many rows of data will be used.

The IF formula can be used effectively to unclutter this worksheet by displaying a blank cell whenever one of the input cells for the formula is blank.

3 Select cell E14 and press to go into edit mode for the cell.

4 Change the formula to: =IF(B14="","",A14*D14).

Learn the Skill This exercise is designed to demonstrate the use of the IF, IFERROR, and OR functions to improve the readability of a worksheet by suppressing the display of error symbols.

For E

valu

atio

n Onl

y

Page 30: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Lesson 3 Formulas and Functions

120 3244-1 v1.00 © CCI Learning Solutions Inc.

The IFERROR formula can be used to accomplish the same result.

5 Select cell D14 and press . Change the formula to appear as:

=IFERROR(VLOOKUP(B14,$B$5:$D$8,3,FALSE),"")

Apply the IF formula to the remaining lookup cell for this row.

6 Select cell C14 and press . Change the formula to appear as:

=IF(B14="","",VLOOKUP(B14,$B$5:$D$8,2,FALSE))

These formulas handle the situation when the cell is blank, so now try an invalid cell entry.

7 Select cell B14 and enter: A4.

Note that cell D14 is the only one of the three modified cells in this row that still shows a blank. The other two display an error symbol again. This demonstrates that the IFERROR formula is more flexible in catching all error conditions. You can use either the IF or IFERROR formula, depending on what result you want to achieve under different conditions.

8 Select cell B14 and enter: A4353.

The OR formula can also be inserted to test multiple conditions.

9 Select cell E14 and press . Change the formula to: =IF(OR(B14="",A14=""),"",A14*D14).

Now test the result of deleting just the part # field.

10 Select cell B14, and press .

You attain the same result as before.

Now see what happens when you delete the contents of the other cells used in the formula.

11 On the Quick Access Toolbar, click Undo.

12 Select cell A14 and press .

This demonstrates how the IF and OR formulas can be combined together to achieve a very satisfactory result. Fo

r Eva

luat

ion

Only

Page 31: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Formulas and Functions Lesson 3

3244-1 v1.00 © CCI Learning Solutions Inc. 121

Restore the deleted cell and copy the modified formulas to the other rows.

13 On the Quick Access Toolbar, click Undo.

14 Select cells C14:E14. Copy the contents of these cells to the cell range C12:E13.

15 Save and close the workbook.

Using Conditional Summary Functions The conditional summary versions of the commonly used summary functions AVERAGE, COUNT, and SUM are very powerful extensions of the base functions. Although the function name has an IF in it, the selection capability works more like filtering: for the given range of cells, Excel first selects only the rows that meet the criteria and applies the summary function on those rows. The remaining rows are ignored.

AVERAGEIF Calculate the average value of a range of cells in which the criterion value is met. The format ofthis function is as follows: AVERAGEIF(criteria_range, criterion_value , average_range) The average range is optional. If it is not specified, the criteria range is assumed to be theaverage range.

COUNTIF Count the number of cells that contain a non-blank value in a range of cells where the criterion value is met. COUNTIF(criteria_range, criterion_value)

SUMIF Calculate the sum total of all cells containing a numeric value in a range of cells where thecriterion value is met. SUMIF(criteria_range, criterion_value , sum_range) The sum range is optional. If it is not specified, the criteria range is assumed to be the sum range.

An example of a conditional summary function is:

=SUMIF(D4:D207,"Visa",F4:F207)

In this function, the criteria range is D4 to D207, the sum range is F4 to F207, and the criterion value is “Visa”; therefore, Excel will examine each of the cells in the range D4 to D207. If the cell contains the value “Visa,” the corresponding numeric value in the cell range F4 to F207 will be included in the sum total.

Note that the SUMIF is very different from the more common SUM function. With SUM, the numeric value in all cells in the sum range are added to the sum total. With SUMIF, the cells are added only if the criterion value is met.

The above three conditional summary functions permit you to perform only one criteria test. If you need to perform more than one criteria test at the same time, then a different version is needed.

For E

valu

atio

n Onl

y

Page 32: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Lesson 3 Formulas and Functions

122 3244-1 v1.00 © CCI Learning Solutions Inc.

AVERAGEIFS Calculate the average value of a range of cells in which the criterion values are met. The format of this function is as follows:

AVERAGEIFS(average_range, criteria_range 1, criteria 1, criteria_range 2, criteria 2…)

The average range is mandatory.

COUNTIFS Count the number of cells that contains a non-blank value in a range of cells where the criterion values are met.

COUNTIFS(range 1, criteria 1 , range 2, criteria 2…)

SUMIFS Calculate the sum total of all cells containing a numeric value in a range of cells where the criterion values are met.

SUMIFS(sum_range, criteria_range 1, criteria 1, criteria_range 2, criteria 2…)

The sum range is mandatory.

An example of this kind of conditional summary function is:

=SUMIFS(F4:F207,D4:D207,"Visa",F4:F207,">100")

In this function, the sum range is F4 to F207, the first criteria range is D4 to D207, and its corresponding criterion value is “Visa”; the second criteria range is F4 to F207 and its corresponding criterion test is >100. This means that a value in the cell range F4 to F207 is included in the sum total only if both criteria tests are evaluated as true. For example, the value in cell F4 is included if D4 contains the word “Visa” and F4 contains a value that is greater than 100. If D4 does not contain the word “Visa,” or if F4 is less than or equal to 100, or both, then the value in F4 is not included.

Because these functions have multiple selection criteria, the sequence of the arguments is different from the single criterion versions of these functions, as described above. The different sequence is necessary to allow multiple selection criteria to be entered as arguments.

1 Open the Customer Sales Rebate – Student workbook.

Enter text into cells to help identify the function of the first set of conditional formulas.

2 Enter the following text into cells:

Cell Text F2 Sales Over $10,000 F3 Total Sales Over $10,000 F4 Avg Sales Over $10,000

Now enter the conditional summary formulas. These formulas are straightforward because they only have one criterion: that, is any value in column C is greater than $10,000.

Learn the Skill This exercise demonstrates the use of conditional summary functions.

To move quickly to a cell, press CTRL+G, which activates the Go To feature, and then enter the cell reference.

For E

valu

atio

n Onl

y

Page 33: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Formulas and Functions Lesson 3

3244-1 v1.00 © CCI Learning Solutions Inc. 123

3 Enter the following formulas into cells:

Cell Text G2 =COUNTIF(C2:C26,">10000") G3 =SUMIF(C2:C26,">10000") G4 =AVERAGEIF(C2:C26,">10000")

Instead of keying the criteria directly into each of the formulas, you could use a cell reference. For example, cell D210 could be =COUNTIF(D4:D207,B210). Referencing a cell that contains the selection criteria makes it easier to change the criteria and avoid forgetting to change a function that contains the selection criteria.

Notice that the SUMIF and AVERAGEIF conditional formulas used here perform their calculations on the same column in which the selection criteria are applied. In other words, these formulas select only those cells that meet the stated criteria and then perform the COUNT, SUM, and AVERAGE on only those cells. The significance of this will become clearer as you examine the next sets of conditional formulas.

Now enter the next set of conditional summary formulas. These pertain only to rows where the sales type is “Corporate.”

4 Enter the following text into cells:

Cell Text F6 Corporate Sales F7 Total Corporate Sales F8 Average Corporate Sales

5 Enter the following formulas into cells:

Cell Text G6 =COUNTIF(B2:B26,"Corporate") G7 =SUMIF(B2:B26,"Corporate",C2:C26) G8 =AVERAGEIF(B2:B26,"Corporate",C2:C26)

These are the same conditional formulas as used previously, except that an additional argument has been added to the SUMIF and AVERAGEIF. In this variation, the criteria are applied to the cells in column B (= “Corporate”), but the SUM and AVERAGE are applied to the corresponding cells in column C, which is where the sales amounts are located. The average value can be verified by dividing the sum value into the count value.

Now enter the third set of conditional summary formulas. These formulas have two criteria: the sale must be a Corporate sale and the sales amount must be greater than $10,000. For this exercise, you will also perform the calculation on a third column. You will recall earlier in this exercise that the rebate is given to a customer only if the sales amount is more than $10,000.

6 Enter the following text into cells:

Cell Text F10 Corporate Rebates 

F11 Total Corporate Rebates F12 Avg Corporate Rebates

7 Enter the following conditional summary formulas into cells:

Cell Text G10 =COUNTIFS(B2:B26,"Corporate",C2:C26,">10000") G11 =SUMIFS(D2:D26,B2:B26,"Corporate",C2:C26,">10000") G12 =AVERAGEIFS(D2:D26,B2:B26,"Corporate",C2:C26,">10000")

Notice that the sequence of the parameters for the sum and average formulas is different in the single-criteria and multiple-criteria versions.

For E

valu

atio

n Onl

y

Page 34: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Lesson 3 Formulas and Functions

124 3244-1 v1.00 © CCI Learning Solutions Inc.

The worksheet should now appear as follows:

8 Save and close the workbook.

Auditing a Worksheet Users automatically assume that spreadsheets are correct and base decisions on the information provided. Spreadsheet usage is pervasive in business and personal applications, ranging in size from major corporate investments to individual life insurance policies and everything in between. The impact from errors in spreadsheets can range from minor inconveniences to major implications on the livelihoods of thousands of employees. The simple checking of formulas should be performed on any worksheet before it is printed or saved.

Using the Error Checking Tool Excel has an error checking feature that greatly reduces time spent auditing formulas for accuracy. If background error checking is enabled, Excel displays a dark green triangle in the upper left corner of a cell to indicate that it contains an inappropriate formula. Possible errors that Excel will highlight include:

formulas that are inconsistent with others in the same row or column.

formulas that refer to a range but omit a cell that is within or adjacent to the range.

formulas that evaluate to an error.

numbers stored as text.

When you select a cell with a green triangle, a box with an exclamation mark (the Trace Error icon) appears beside it. Select the button to display a drop-down menu that describes the problem and offers to fix it.

Alternatively, on the Formulas tab, in the Formula Auditing group, click Error Checking.

2.1 2.4

For E

valu

atio

n Onl

y

Page 35: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Formulas and Functions Lesson 3

3244-1 v1.00 © CCI Learning Solutions Inc. 125

1 Open the Rocky Mountains Tour workbook and save it as Rocky Mountains Tour – Student.

Tolano Adventures is using this spreadsheet to compare the revenues to the expenses for a planned tour. The numbers appear to indicate that a healthy profit will be made.

However, this worksheet has formulas with errors in them. Wherever Excel believes that a formula is incorrect, it displays an Error Indicator (green triangle at the upper left corner) in the cell. By default, this background error checking is turned on. You can verify this by looking in the Options dialog box.

2 Click File and then click Options. In the Excel Options dialog box, click the Formulas category.

Learn the Skill This exercise demonstrates how to use Excel’s Error Checking tool to find errors in formulas.

For E

valu

atio

n Onl

y

Page 36: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Lesson 3 Formulas and Functions

126 3244-1 v1.00 © CCI Learning Solutions Inc.

3 Ensure that the Enable background error checking check box is turned on.

Notice that you can also change the color of the Error Indicator triangle or toggle various error checking rules on or off.

4 Click the Reset Ignored Errors button and then click OK to close the dialog box.

An error indicator (the small green triangle) is now visible in the upper left corner of cell D21, indicating that it contains a possible formula error.

5 Select cell D21 and click the Trace Error icon to the left of this cell.

At the top row of the Trace Error menu, Excel describes the problem it has identified: the formula in this cell does not include adjacent cells containing data that you may have wanted to include. At this point, you should check the contents of the formula bar to determine whether to change this formula.

6 Look at the Formula Bar for this cell.

The formula in this cell is =SUM(D13:D19). However, cells D12 to D20 contain expense numbers.

7 In the Trace Error menu, click Update Formula to Include Cells.

If you select Ignore Error, the green triangle disappears and the error is not identified in future error checks (unless you click Reset Ignored Errors in the Excel Options window).

8 Click Undo in the Quick Access Toolbar to revert the formula back to its previous value.

Instead of checking each cell one by one, you can use the Error Checking tool to automatically select the next one.

9 Select cell A1 or any cell at the top of the worksheet.

This step demonstrates how Excel behaves when you use the error checking tool. In fact, it doesn’t matter where the cell pointer is when you carry out the next step.

10 On the Formulas tab, in the Formula Auditing group, click Error Checking.

The cursor jumps to the first cell that Excel finds with a potential error in it.

Excel has found the formula error again in this cell.

11 Click Update Formula to Include Cells.

For E

valu

atio

n Onl

y

Page 37: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Formulas and Functions Lesson 3

3244-1 v1.00 © CCI Learning Solutions Inc. 127

When Excel can no longer find any problems with formulas, it displays the following:

12 Click OK.

Your worksheet should now look like the following:

This updated worksheet shows that the profit has been substantially reduced, but there is still a small profit being made.

13 Save the workbook.

Tracing Formula Errors Another method of finding formula errors is to use tracing tools. These tools draw arrows to help you trace cells that are precedents or dependents of the current cell. By following the lines and dots in the arrows, you can determine which cells are referenced in formulas.

When you select a cell and trace its precedents, Excel draws lines from other cells leading to the current active cell (i.e., preceding it). Excel also draws box outlines around these cells. This is a visual way of examining a worksheet to see which cells are being referenced by formulas. In a complex worksheet with many formulas, this is a very useful tool to ensure they are all correct.

The reverse can also be done by selecting a cell and tracing its dependent cells; Excel draws lines to any cells that use the data in the current active cell, directly and indirectly. Dependent cells contain formulas that reference the current active cell (i.e., depending on it).

You can extend the tracing of precedent or dependent cells by selecting Trace Precedents or Trace Dependents again in the Ribbon.

For E

valu

atio

n Onl

y

Page 38: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Lesson 3 Formulas and Functions

128 3244-1 v1.00 © CCI Learning Solutions Inc.

1 If necessary, open the Rocky Mountains Tour – Student workbook.

Start by selecting the most important cell in the entire workbook—the one that calculates the profit of Revenues less Expenses.

2 Select cell D23 and then, on the Formulas tab, in the Formula Auditing group, click Trace Precedents.

Notice the thin line and the dots drawn from cell D9 to D23. The dots in cells D9 and D21 indicate that these cells are referenced in the formula in cell D23. These appear to be correct.

3 With cell D23 still selected, click Trace Precedents again.

As the Trace Precedents tool drives down through the next layer of detail, Excel draws boxes above cells D9 and D21. The boxes indicate that these cell ranges are referenced in the formulas in the two cells. These also appear to be correct.

4 Click Trace Precedents one more time.

Another set of lines and dots are drawn as the Trace Precedents tool drives down through another layer of detail. These indicate the cells referenced in the formulas entered into the cell range D6:D8.

Learn the Skill In this exercise, you will use the auditing tools on the Rocky Mountains Tour workbook to see if there are any other formula errors.

For E

valu

atio

n Onl

y

Page 39: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Formulas and Functions Lesson 3

3244-1 v1.00 © CCI Learning Solutions Inc. 129

Looking at the last set of lines and dots drawn, you should see that they do not appear correct. The fare value in cell B6 is used to calculate the total in cells D6 to D8, but the fares in cells B7 and B8 are not used at all.

5 Select cell D7.

By selecting cell D7, you can see that the formula is incorrect.

6 Change the formula in cell D7 to: =B7*C7.

7 Select cell D8 and change the formula to: =B8*D8.

8 Select cell D23 and click Trace Precedents again.

The lines and dots now appear in the correct cells. It also now appears that this tour will incur a loss instead of a profit.

When you have completed auditing the worksheet, you can remove the arrows.

For E

valu

atio

n Onl

y

Page 40: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Lesson 3 Formulas and Functions

130 3244-1 v1.00 © CCI Learning Solutions Inc.

9 On the Formulas tab, in the Formula Auditing group, click Remove Arrows.

Instead of finding the precedent cells, you can find cells containing formulas that depend on the value in a selected cell, either directly or indirectly. This is the reverse method: tracing dependent cells.

10 Select cell B6 and, on the Formulas tab, in the Formula Auditing group, click Trace Dependents.

11 Click Trace Dependents two more times.

The worksheet now appears similar to the following:

12 Save and close the workbook.

Evaluate Formulas Excel formulas do an excellent job of performing calculations that are sometimes very complex. Even when a formula is seemingly simple, you may be puzzled about why the result is different than what you expected. You can use the Evaluate Formula feature to force Excel to slow down and perform each of the internal calculations in a formula one step at a time. As it performs each step, you can see the intermediate results, which will help you understand where the data are coming from.

For E

valu

atio

n Onl

y

Page 41: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Formulas and Functions Lesson 3

3244-1 v1.00 © CCI Learning Solutions Inc. 131

The Evaluate Formula dialog box shows the formula that is in the selected cell in the Evaluation text box. An underline appears under the cell reference (or expression) that is about to be evaluated. You can then choose one of three buttons:

Evaluate If the underline appears under a cell reference, press this button to obtain the value from that cell and display it in the formula. If the underline is under an arithmetical expression, press this button to perform the arithmetic and display the result.

Step In If the underline appears under a cell reference, press this button to display the value from that cell.

Step Out If you have stepped into a cell to display its value, press this button to step out of the cell.

You may find the Evaluate Formula feature difficult to use. It is time-consuming to track every step inside the formula as it performs each calculation or cell reference. You will most likely have to repeat the evaluation several times before identifying the errant calculation. As a result, you may want to use the Evaluate Formula feature only as a last resort (i.e., if you are unable to debug it any other way).

1 Open the Travel Miles workbook and save it as Travel Miles – Student.

This worksheet combines the contents of two cells—C1 and C2—to form a sentence, as shown in cell C4. The intention is to enter different points values in cell C1 for different customer transactions and display a friendly message from cell C4 on a document, such as an e-mail or statement for the customer.

2 Select cell C4.

This formula looks very intimidating, as it contains up to three levels of nested functions in some parts. The purpose of this function is to replace the “XX” in the template wording in cell C2 with the number from cell C1.

Although there are easier ways of achieving this result, for this exercise we will assume that this is the optimal method. However, the displayed text in the cell is incorrect because there is an extra “X” still in place before the value 300. You will need to find out what to fix in the formula to remove that “X”.

3 On the Formulas tab, in the Formula Auditing group, click Evaluate Formula.

The Evaluate Formula dialog box first shows the full formula. The underline under the first cell reference indicates that it will be the first to be evaluated. The Evaluate button will show the result of that cell reference as it is translated.

4 Click Evaluate.

Learn the Skill This exercise demonstrates how to use the Evaluate Formula feature.

For E

valu

atio

n Onl

y

Page 42: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Lesson 3 Formulas and Functions

132 3244-1 v1.00 © CCI Learning Solutions Inc.

The Evaluation box now shows a current value of ”Travel miles points earned – XX” where C2 used to be. The underline is now under the next cell reference, which is a reference to cell C2 again. The Evaluation box helps you by translating the formula piece by piece as it executes each calculation and cell reference. Pressing the Evaluate button forces Excel to perform one calculation at a time.

5 Click Evaluate again.

The underline is now under FIND(“XX”,”Travel miles points earned – XX”). If you recall your text functions, you will know that this finds the position of the characters “XX” in the text string and returns the number representing that position.

6 Click Evaluate again.

The underline is now under MID(”Travel miles points earned – XX”,1,30). The previous FIND function returned the value 30.

7 Click Evaluate again.

The result of the MID function is ”Travel miles points earned – X”. You have now found the location of the error because the extra “X” appears here. The MID function needs to extract one less character at the far right end. By looking in the Formula Bar, you will notice that it is the FIND function that calculates the number of characters to extract. The correction is to subtract 1 from that number.

8 Click Close.

9 If necessary, select cell C4 again. Change the formula to:

     =CONCATENATE(MID(C2,1,FIND("XX",C2)‐1),TEXT(C1,"#,##0"))

Notice the “-1” is added at the right of the FIND function.

If you lose track of what the original formula looks like, look up at the Formula Bar.

For E

valu

atio

n Onl

y

Page 43: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Formulas and Functions Lesson 3

3244-1 v1.00 © CCI Learning Solutions Inc. 133

The worksheet should now appear similar to the following:

The text displayed in cell C4 is now correct.

In evaluating this formula, you only used the Evaluate button. There are also the Step In and Step Out buttons.

10 Select cell C4 again and, on Formulas tab, in the Formula Auditing group, click Evaluate Formula.

11 Click Step In.

When you used the Evaluate button earlier, the C2 was simply replaced with the cell value in the Evaluation box. The Step In button shows you the contents of the cell in C2 in a separate box before completing that replacement.

12 Click Step Out.

13 Click Evaluate seven more times to perform this function.

The Evaluation window now shows the completed result of the entire formula, and the Evaluate button has changed to a Restart button.

14 Click Restart.

When you press the Restart button, the evaluation starts over again.

15 Click Close.

16 Select cell C2 and change the text to: Travel miles points you earned today – XX.

17 Select cell C1 and enter: 1500.

For E

valu

atio

n Onl

y

Page 44: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Lesson 3 Formulas and Functions

134 3244-1 v1.00 © CCI Learning Solutions Inc.

The displayed text in cell C4 automatically adjusts itself to the new template wording and points value, because of the flexibility of the function used in that cell.

18 Save and close the workbook.

Manual Checking and Displaying Formulas As demonstrated earlier, the Error Checking tool is not 100% reliable. For example, if all of the formulas in a row refer to values in the same incorrect row, Excel will not find the error. Also, Excel ignores inconsistencies if formulas reference other formulas rather than values. Therefore, you should still manually check formulas for accuracy.

Manually checking a worksheet means selecting every cell in the worksheet to determine if it contains the right value or formula. If it is a formula that references other cells, you should look and verify that the correct cells are being referenced. Excel displays cell range references visually when you press to help you verify that these formulas are correct.

A useful feature to help you review all of the formulas in a worksheet at the same time is the Show Formulas option. This feature forces every cell to display the formula instead of the final calculated value.

1 Open the Rocky Mountains Tour workbook.

Activate the Show Formulas feature.

2 On the Formulas tab, in the Formula Auditing group, click Show Formulas.

3 If necessary, adjust the size of the Excel workbook window so that you can see the cell range A1:D23.

Note the formula in each cell to verify whether it is correct or not.

4 Select cell D21.

The worksheet should appear as follows:

Learn the Skill This exercise demonstrates how to check worksheets to ensure there are no formula errors.

For E

valu

atio

n Onl

y

Page 45: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Formulas and Functions Lesson 3

3244-1 v1.00 © CCI Learning Solutions Inc. 135

A nice feature in Excel is that the cells referenced in the active cell are highlighted with a colored border.

5 Click on some of the other cells that appear to be incorrect, such as cells D7 and D8.

6 On the Formulas tab, in the Formula Auditing group, click Show Formulas again to turn the formula display off.

7 Close the workbook and discard any changes made.

Review Questions 1. List each of the components of a function, and explain why it is important to ensure that

the syntax of the function is correct.

2. How is the COUNT function different from COUNTA?

3. What is the formula for adding 10 days to the current date? Will this formula still be accurate even if today is December 29?

4. Are the LEFT and MID functions fully interchangeable? In other words, can you always use the LEFT function instead of MID, as well as using MID instead of LEFT?

5. Which function would you use to convert a number such as 10 to the text string “ten”?

6. Describe a situation in which conditional logic functions are useful.

7. How do conditional summary functions such as SUMIFS or AVERAGEIFS differ from SUM or AVERAGE?

8. What are some of the suspicious conditions that the Excel Error Checking tool will flag for you?

9. Why should you check the formulas in your worksheet manually?

10. How can you display all the formulas in a worksheet at once in order to identify all errors in the formulas, or do you need to check each cell individually?

Lesson Summary In this lesson, you learned about the different types of functions available in Excel for specific calculations, how to activate these functions, and how to apply them. You also looked at different ways of finding and correcting errors in your formulas. You should now be able to:

define what a function is

use the correct syntax for functions

insert a function

use mathematical and trigonometric functions

use statistical functions

use financial functions

use logical functions

use date and time functions

use text functions

use information functions

use conditional logic and summary functions

convert data types

use the Error Checking Tool to mark possible incorrect formulas

trace formula errors

use the evaluate formula feature to debug a formula

check the worksheet manually for formula errors

MMM Go online for

Additional Review and

Activities

For E

valu

atio

n Onl

y

Page 46: Microsoft Excel 2010 - CCI Learningccilearning.com/store-ca/wp-content/uploads/2014/10/3244-Excel... · Microsoft® Excel ® 2010 Expert ... Lesson 3 Formulas and Functions ... The

Lesson 3 Formulas and Functions

136 3244-1 v1.00 © CCI Learning Solutions Inc.

For E

valu

atio

n Onl

y