Lesson 6 – Using Functions & Formulas

In Lesson 5 you learned about the general rules for good spreadsheet design, regardless of whether you’re working in Excel or another spreadsheet application. In that lesson you walked through the steps to designing a worksheet, beginning at the design phase, then building your base elements (row & column headers), followed by populating the worksheet with some sample data. After that you saw how to use the AutoSum Wizard to add some relatively simple formulas to the worksheet. The natural progression to that lesson is to introduce you to the more esoteric topic of Functions and Formulas. While the AutoSum Wizard can certainly do a lot for you, and you will likely come to rely on it in your day-to-day Excel activities, there is a whole world of Functions out there that the AutoSum Wizard will never touch, so we’re going to devote this lesson to some of Excel’s more commonly used Functions, and Formulas. We’re not going to overwhelm you with obscure and industry specific functions, like those you might use in Statistical, Scientific or Engineering applications, but we will talk about some of the more advanced functions that once you learn how to use you’ll wonder how you ever did without. We’ll also be discussing some of the logic that goes into functions and how you evaluate certain scenarios. Some of it might smell a bit like high school Algebra, and to a certain extent it is, because you’ll learn how to evaluate conditions and return different answers based on those conditions.

Remember from the last lesson that a Function in place and receiving input is a Formula, but a Formula doesn’t necessarily have to contain a Function. It can be a hard concept to grasp at first, but once you start working with Functions and Formulas a bit more you’ll see how they are truly complimentary. A Function is any pre-programmed function that performs some mathematical or logical task in Excel based on input or argument that you supply to it. Functions are generally intrinsic to Excel, but you can also build your own (in much the same fashion that Microsoft builds them). A formula is either a Mathematical or Text equation (=1+1, =A1+B1, =”Daily Sales “&A1, etc.), or it can be a function, or a compilation of functions (=SUM(A1:B1) or =SUM(A1:B1)/SUM(C1:D1) or even something like =SUM(A1:B1)*.0825). Essentially if you can think of a way to evaluate data then you can probably combine some type of logic in Excel to do it. In fact, if you start getting curious about more advanced functions and look for help in Excel message boards on the Internet you will be truly amazed at some of the formulas that people can create. If you can think it, someone can probably come up with a formula to do it. Why emphasize this issue? Because you will (not might, but will) become frustrated at some point or another when you’re building formulas, that is just a statistical reality. In fact, it can be a fairly regular occurrence, but you shouldn’t let that be a deterrent. Some people will have a much easier time grasping formulas than others, but rest assured, even the most experienced Excel users on the planet struggle with formulas from time to time, so you are certainly not alone. As soon as you let yourself know that it’s OK to get frustrated, then you’ll generally be much better prepared to tackle advanced formulas.

First we need to review the Functions that are on the Formula Ribbon and explain what each group does. We’ve briefly discussed some of this in the Ribbon lesson, but now we’re going to get in depth with each one.

6.1.jpg 

Figure 231  

Insert Function

If you don’t know what Function you want off the top of your head, or even what category to place it in, then you come here.

6.2.jpg 

6.3.jpg 

Figure 232  

Function Library

6.4.jpg 

Figure 233  

Order of Operations

Before we start exploring some of Excel’s in-depth functionality with regards to functions and formulas, you need to understand how they calculate. Excel follows a mathematical order of Operations when it calculates your functions and formulas. The Primary order of operations is as follows:

6.5.jpg 

Entering Functions

Entering functions is fairly straightforward. If you’re beginning from the Function Wizard, then you let that do all of the work for you. Here’s an example using the Depreciation example you’ll find in the Financial section of the Lesson 6 workbook.

6.6.jpg 

Figure 234  

6.8.jpg 6.7.jpg 

Figure 235  

6.9.jpg 

Figure 236  

6.10.jpg 

Figure 237  

6.11.jpg 

Figure 238  

Excel Function/Formula Errors

As you’ve seen, when you properly enter a function/formula, Excel gives you a result. But what happens if you enter a function/formula incorrectly? Well, as picky as Excel is, it’s going to tell you all about it, by displaying an Error message in the cell. Some error messages are fairly straightforward and can be fixed right away, while others are a bit more obtuse, and can be difficult to track down (especially if a change you made on a different worksheet causes an error and you don’t see it until much later). You’ll find that error management often means using Logical statements to evaluate the function and/or the error to resolve it. Errors play a big role in Excel development, as they can quickly point out problems that you need to resolve. Unfortunately, many people throw a blanket error management solution at everything, which can be misleading because it prevents Excel from telling you some thing’s wrong. Before you start using error management practices, make sure that you understand errors, what causes them and how to sort out the root cause before using a shotgun approach.

6.12.jpg 

Commonly Used Business Functions

The rest of this lesson will be sharing and explaining function examples with the Lesson 6 workbook. We’ll discuss where and when you might use these functions and then show you how to set up a scenario to use them, followed by actually putting them together. You’ll probably spend a lot of time switching between the lesson and the companion workbook, because it’s generally better to be hands on when you’re learning functions and how to use them. We’re going to go back through the Functions in the same order they are on the Formula Ribbon and use the top four or five from each category, as well as some beneficial formulas. Unfortunately, this is by no means an exhaustive list of all of Excel’s functions, but there will be some Microsoft references in the Lesson Summary.

6.13.jpg 

FV.jpg 

Figure 239  

NPER.jpg 

Figure 240  

6.14.jpg 

Figure 241  

6.15.jpg 

Figure 242  

6.16.jpg 

Figure 243  

6.17.jpg 

Figure 244  

DB.jpg 

Figure 245  

=IF(A1=1,1,IF(A1=2,2,IF(A1=3,3),IF(A1=4,4),IF(A1=5,5))))

6.18.jpg 

6.19.jpg 

Figure 246  

=IF(A1>=90,”A”,IF(A1>=80,”B”,IF(A1>=70,”C”,IF(A1>=60,”D”,IF(A1<60,”F”)))))

=IF(A1>25000,A1*2%,IF(A1>15000,A1*1.5%,IF(A1>5000,A1*1%,0)))

6.20.jpg 

Figure 247  

6.21.jpg 

Figure 248  

6.22.jpg 

Figure 249  

6.23.jpg 

6.24.jpg 

6.25.jpg 

Figure 250  

=LOOKUP(B4, {0,60,70,80,90}, {“F”,”D”,”C”,”B”,”A”})

VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])

=VLOOKUP(Lookup what?, Lookup where?, How many columns over should it go?, Exact or Approximate Match?)

6.26.jpg 

Figure 251  

6.27.jpg 

6.28.jpg 

Figure 252  

=HLOOKUP($B5,$A$7:$F$16,MATCH(C4,$A$7:$A$16,0),FALSE)

6.29.jpg 

=INDEX(A7:F16,4,4)

=INDEX($A$7:$F$16,MATCH(C19,$A$7:$A$16,0),MATCH($B20,$A$7:$F$7,0))

6.30.jpg 

Figure 253  

6.31.jpg 

6.32.jpg 

Figure 254  

=SUMIF(A2:A17,E2,C2:C17)

6.34.jpg 

Figure 255  

=SUMIFS(C2:C17,A2:A17,E2,B2:B17,F2)

6.35.jpg6.36.jpg 

Figure 256  

6.37.jpg 

Figure 257  

=COUNTIF(A2:A17,E2)

6.38.jpg 

Figure 258  

=COUNTIFS(A2:A17,E2,B2:B17,F2)

6.39.jpg 

Figure 259  

=AVERAGEIF(A2:A17,E2,C2:C17)

6.40.jpg 

Figure 260  

=AVERAGEIFS(C2:C17,A2:A17,E2,B2:B17,F2)

=January!A1+February!A1+March!A1+April!A1+May!A1+June!A1+July!A1+August!A1+September!A1+October!A1+November!A1+December!A1

=SUM(January:December!A1)

6.41.jpg 

Figure 261  

Unit Summary: Lesson 6 – Using Functions & Formulas

Review Questions

1. What functions can you find in the AutoSum Wizard

a. __________________________________________________

b. __________________________________________________

c. __________________________________________________

d. __________________________________________________

e. __________________________________________________

2. What are four of the Function Library groups?

a. __________________________________________________

b. __________________________________________________

c. __________________________________________________

d. __________________________________________________

3. What’s the difference between a Function and a Formula?

a. __________________________________________________

4. How is =12+(5*2) different from =12+5*2?

a. __________________________________________________

5. What are some Functions that will be useful as you become more comfortable with Excel?

a. __________________________________________________

b. __________________________________________________

c. __________________________________________________

d. __________________________________________________

Lesson Assignment – Lesson 6 – Using Functions & Formulas

Your assignment is to open the companion workbook and review the examples there, if you haven’t already. Once you’ve had some time to get the feel for the functions and formulas there, insert a new worksheet and start entering the functions that you identified in Question 5.

(There is a Notes section below for you to keep track of your observations):