Excel2007 Advanced Calculations

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Microsoft Excel 2007

Advanced Calculations
OTS PUBLICATION :

E23X REVISED 6/9/2008 TRAINING @ TOWSON . EDU OFFICE OF TECHNOLOGY SERVICES =Shortcut =Advice =Caution

Introduction
There are over 400 different built-in formulas, or Functions as they Calculations Summary are called, in Excel 2007. These functions enable you to create simple to complex calculations easily and effectively. All the functions are 1. AutoCalculate organized into categories to make them easy to find and they include, 2. Relative Reference Financial, Date & Time, Math & Trig, Statistical, Lookup & Reference, 3. Absolute Reference Database, Text, Logical, Information, Engineering and Cube. 4. Functions Alternatively, you can simply use the All category to view all functions SUM in alphabetical order by name. AVERAGE MEDIAN This document covers how to insert various a functions using the MODE Insert Function button on the Formulas tab. It also covers using the COUNT AutoCalculate feature, using Relative vs. Absolute references, the AuMAX toSum button, and how to create a 3D formula. MIN TODAY AutoCalculate NOW IF You can use the AutoCalculate feature when you need to know the Nested IF sum of a range of values without having to add a formula to the VLOOKUP Worksheet. Select any range of cells (Figure 1, 1) and Excel displays HLOOKUP the answer on the Status Bar (Figure 1, 2). In addition to displaying PMT (Payment) the Sum of a range you can also choose between six basic functions, FV (Future Value) such as Average, Count, Numerical Count, Minimum, and Maximum. 5. 3D Formula To use a different AutoCalculate function, right-click on the current answer on the Status Bar (Figure 1, 2) and select a desired function from the shortcut menu. Figure 1

2008 Towson University -This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivs License. Details available at http://www.towson.edu/OTStraining. 410-704-4070.

M ICROSOFT E XCEL 2007: A DVANCED C ALCULATIONS

Relative Reference vs. Absolute Reference


Relative Reference
In Excel, a Relative Reference is the address of a cell, or range of cells, that changes when it is moved, copied, or the relationship to it has changed (e.g. if you insert additional rows or columns). For example, in a spreadsheet, a cell with a relative reference changes its formula when copied elsewhere. Figure 2

Notice the cell references adjust according to their location when you copy the formula in E5 down though E8

Absolute Reference
Sometimes, however, in a calculation you need to anchor a cell reference so that it doesnt move on you when you copy the formula to other locations. In order to do so, you need to make the reference Absolute so that the cell address does not change. To make a cell reference Absolute, you must type a dollar sign ($) before the column reference and another dollar sign ($) before the row reference. You can also just press F4 on the keyboard The F4 key lets you toggle between relative, absolute and two types of mixed cell references. If you press Ctrl + ~ (tilde) on the keyboard, Excel toggles between displaying the values and formulas. Figure 3

Notice the first cell reference adjusts according to the new row, but the second reference is Absolute (anchored) to H1, the commission value.

M ICROSOFT E XCEL 2007: A DVANCED C ALCULATIONS

About Functions
Formulas can be made much more efficient by using worksheet functions. There are over 400 different Functions in Excel 2007. Functions can be thought of as being made up of three parts: an equal sign, a function name and a list of arguments enclosed in brackets. There are several ways you can insert your functions, but the most common methods are:

Select the Insert Function button from the Formulas tab. Click the Insert Function button
on the Formula bar.

Press Shift + F3 on the keyboard to display the Insert Function dialog box. Type the function completely from scratch.

Using the Insert Function Dialog Box


Using the Insert Function dialog box helps you walk through setting up your new formula. This dialog box is designed to try and help you find the correct function. Select Insert Function button from the Formulas tab and the Insert Function Dialog box displays. If you do not know the exact name of the function you need, you can scroll the ALL categories list or filter the list of available functions by selecting a specific category from the dropdown list. After you select a function and have clicked OK, the Function Arguments dialog box displays. This is where you indicate the arguments that are required by that function. Figure 4

Functions are organized into categories. You can find any function in the All category.

M ICROSOFT E XCEL 2007: A DVANCED C ALCULATIONS

About Arguments
Arguments are part of the formulas and can be numbers, text, cell references (e.g. A1:A15), named ranges (e.g. GradeTable), arrays, formulas or even other functions (a.k.a. Nested Functions). The Function dialog box displays the Formula result (Figure 5, 1) so that you have an idea if you are on the right track before accepting the formula by clicking the OK button. If you need help with any function, click Help on this function (Figure 5, 2). Figure 5

This function requires only one argument; a cell range.

1 2

The Sum Function


The most commonly used function in Excel is the SUM function. The SUM function returns the total of all the numbers in a range of cells. This formula can be typed from scratch and the cell addresses do not need to be adjacent to each other. Basic Concept: =SUM(number1, number2,number3,...) Example: Example 2: =SUM(B5:B8) =SUM(B5,C8,D12,E15) Figure 6

The Sum function in this example is adding up the numbers in cells B5 through B8.

M ICROSOFT E XCEL 2007: A DVANCED C ALCULATIONS

AutoSum Button
Since one of the most common tasks for spreadsheets is to sum a range of values, Excel has a special button that helps you do just that. The AutoSum button is on the Formulas tab and also on the Home tab. As step one, before you click the AutoSum button, it is recommended that you select the cell where you want the answer. When you click on the AutoSum button, the Sum function and a suggested range to be added are displayed and highlighted in the formula bar. You can change this range if it is not correct by either typing or drag-selecting the correct range. If you click the down arrow on the AutoSum button, you can also use other commonly used Functions such as AVERAGE, COUNT NUMBERS, MAX, MIN.

AVERAGE Function
Another common calculation in Excel is the AVERAGE function (Figure 7, 1). The AVERAGE function is a Statistical function which returns the arithmetic mean of a list of values. In other words, it adds up the total value of all the cells selected and divides it by the number of cells selected. Basic Concept: =AVERAGE(number1, number2, number3,) Example: =AVERAGE(B6:F6)

MEDIAN Function
Another type of statistical function is the MEDIAN function (Figure 7, 2). The MEDIAN function returns the middle of a distribution (half the scores are above the median and half are below the median) of all the numbers evaluated by the formula. Basic Concept: =MEDIAN(number1, number2, number3,...) Example: =MEDIAN(B6:F6)

MODE Function
A third type of statistical function is the MODE function (Figure 7, 3). The MODE function returns the most common or frequent value in a data set. It is possible that there is no match and Excel displays #N/A (Figure 7, 1). Basic Concept: = MODE(number1, number2, number3,...) Example: =MODE(B6:F6)

COUNT NUMBERS Function


A fourth type of statistical function is the COUNT NUMBERS function (Figure 7, 4). The COUNT NUMBERS function counts the total number of cells that contain numbers or data. Basic Concept: =COUNT(value1, value2,...) Example: =COUNT(B6:B17)

M ICROSOFT E XCEL 2007: A DVANCED C ALCULATIONS

MAX Function
Another type of statistical function is the MAX function (Figure 7, 5). The MAX function returns the largest (maximum) value of all the numbers evaluated by the formula. Basic Concept: =MAX(number1, number2, number3,) Example: =MAX(B6:B17)

MIN Function
Another type of statistical function is the MIN function (Figure 7, 6). The MIN function returns the smallest (minimum) value of all the numbers evaluated by the formula. Basic Concept: =MINnumber1, number2, number3,) Example: =MIN(B6:B17)

Figure 7

The formulas below are all using the grades listed in cells A2 through A8. Each formula provides a different statistical answer.

M ICROSOFT E XCEL 2007: A DVANCED C ALCULATIONS

TODAY Function
The Today function is a volatile Date and Time function that returns the current date. This function will update the date each time the file is opened or saved. This function does not require any arguments, but you must still include the empty parentheses after the function name (Figure 8, 1). Basic Concept/Example: =TODAY() It is probably quicker to type the TODAY function from scratch. If you do, make sure you include the open and closed parenthesis after the function name no argument is needed for this function.

NOW Function
The NOW function returns the current date and time. This function will update the date each time the file is opened or saved. This function does not require any arguments, but you must still include the empty parentheses after the function name. Basic Concept/Example: =NOW() Similar to the TODAY function, it is also quicker to type the NOW function from scratch. If you do, make sure you include the open and closed parenthesis after the function name no argument is needed for this function. Figure 8

M ICROSOFT E XCEL 2007: A DVANCED C ALCULATIONS

IF Function
The IF function is a Logical function that is designed to return one value if a condition you specify evaluates to be TRUE and another value if it evaluates to be FALSE. In other words, the function can only give one of two possible answers. For example, if you exceed the sales quota, you get a bonus, if not, you get nothing; or as shown in Figure 9, if the value in the cell E7 is greater than cell F7, multiply cell E7 by 10%, or display 0 (zero). Basic Concept: =IF(logical_test, value_if_true, value_if_false) Example: =IF(E7>F7,E7*0.1,0) Figure 9

When using the Insert Function dialog box, notice the formula is entered in the formula bar as well as in the selected cell.

Nested IF Function
A Nested function is simply a function within another function. The result returned from one function is used as the argument of another function. A nested formula can contain up to seven levels of arguments and do not need to be IF functions. Basic Concept: =IF(logical_test,=IF(logical_test, value_if_true, value_if_false)) Example: =IF(I9=1,H9*0.1,IF(I9=2,H9*0.08,H9*0.07))

M ICROSOFT E XCEL 2007: A DVANCED C ALCULATIONS

VLOOKUP Function
The VLOOKUP function is a Lookup function that searches vertically for a value in the leftmost column of a (lookup) table and returns a value in the same row from another column you specify (Figure 10). The values in the lookup column must be sorted in ascending order. Notice the Table_array reference is entered as absolute (Figure 10, 1). See also the Relative Reference vs. Absolute Reference section of this document. It is recommended to make your Table_array reference absolute when using any lookup function so that you can easily copy the formula. You can quickly anchor a reference by pressing the F4 key on the keyboard. Basic Concept: =VLOOKUP(lookup_value, table_array, col_index_num,range_lookup) Example: =VLOOKUP(F5,$B$17:$C$29,2) Figure 10

The VLOOKUP function is looking up the Avg Score in cell F5 (88%), then looks in the Letter Grade Table below and returns the associated letter grade in the same row, but in column 2 of the table. An Avg Score of 88% returns a grade of B+.

HLOOKUP Function
The HLOOKUP function is another Lookup function, but this one searches horizontality for a value in the top row of a table and returns a value in the same column from a row you specify. The values in the lookup row must be sorted in ascending order. Basic Concept: =HLOOKUP(lookup_value, table_array, row_index_num,range_lookup) Example: =HLOOKUP(F5,$B$34:$N$35,2)

M ICROSOFT E XCEL 2007: A DVANCED C ALCULATIONS

PMT Function
The PMT function is a Financial function that calculates the payment for a loan based on constant payments and a constant interest rate (Figure 11). Note: The interest rate must be divided by 12 to get a monthly rate (12 months in a year). The number of years the money is paid out is multiplied by 12 to get the number of monthly payments. Basic Concept: =PMT(rate,nper,pv,fv,type) Example: =PMT(B5/12,B6,B8,0,1) Figure 11

The PMT function calculates the payment for a loan based on a fixed interest rate and constant payments over time. Only the Rate, Number of Periods and Present Value fields are required.

FV Function
The FV function is a Financial function that calculates the future value of an investment based on periodic, constant payments and a constant interest rate (Figure 12). Note: The annual interest rate is divided by 12 because it is compounded monthly. Basic Concept: = FV(rate,nper,pmt,pv,type) Example: =FV(B18/12,B19,B20,0,1) Figure 12

The FV function calculates the future value of an investment based on a fixed interest rate and constant payments over time. Only the Rate, Number of Periods and Payment fields are required.

10

M ICROSOFT E XCEL 2007: A DVANCED C ALCULATIONS

3D Formula
A 3D formula is a special formula that typically refers to specific cells across multiple worksheets. This formula is also sometimes called a cubed formula. A 3D formula can calculate a running total across worksheets by simply adding the desired cells (Figure 13, 1), or it can use another function to calculate across worksheets, such as the SUM function (Figure 14, 1). Basic Concept: =Sheet1Name!Cell1Name+ Sheet2Name!Cell2Name+ Example1: Example2: =January!D5+February!D5+March!D5 =SUM(January!D5,February!D5,March!D5)

Figure 13

This 3D Formula calculates a running total across the January, February and March worksheets using operators, in this case plus signs.

11

You might also like