Excel2007 Advanced Calculations

Embed Size (px)

Citation preview

  • 7/31/2019 Excel2007 Advanced Calculations

    1/11

    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.

    Microsoft Excel 2007Advanced CalculationsOTS PUBLICATION: E23X REVISED6/9/2008 [email protected] OFFICEOFTECHNOLOGYSERVICES

    =Shortcut =Advice =Caution

    IntroductionThere are over 400 different built-in formulas, or Functions as theyare called, in Excel 2007. These functions enable you to create simple

    to complex calculations easily and effectively. All the functions are

    organized into categories to make them easy to find and they include,

    Financial, Date & Time, Math & Trig, Statistical, Lookup & Reference,

    Database, Text, Logical, Information, Engineering and Cube.

    Alternatively, you can simply use the All category to view all functions

    in alphabetical order by name.

    This document covers how to insert various a functions using the

    Insert Function button on the Formulas tab. It also covers using the

    AutoCalculate feature, using Relative vs. Absolute references, the Au-

    toSum button, and how to create a 3D formula.

    AutoCalculateYou can use the AutoCalculate feature when you need to know the

    sum of a range of values without having to add a formula to the

    Worksheet. Select any range of cells (Figure 1, 1) and Excel displays

    the answer on the Status Bar (Figure 1, 2). In addition to displaying

    the Sum of a range you can also choose between six basic functions,

    such as Average, Count, Numerical Count, Minimum, and Maximum.

    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.

    1. AutoCalculate

    2. Relative Reference

    3. Absolute Reference

    4. Functions

    SUM

    AVERAGE

    MEDIAN

    MODE

    COUNT

    MAX

    MIN

    TODAY

    NOW

    IF

    Nested IF

    VLOOKUP

    HLOOKUP

    PMT (Payment)

    FV (Future Value)

    5. 3D Formula

    Calculations Summary

    Figure 1

    1

    2

  • 7/31/2019 Excel2007 Advanced Calculations

    2/11

    2

    MICROSOFT EXCEL 2007: ADVANCED CALCULATIONS

    Relative Reference vs. Absolute ReferenceRelative Reference

    In Excel, a Relative Reference is the address of a cell, or range of cells, that changes when it ismoved, 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 copiedelsewhere.

    Absolute ReferenceSometimes, however, in a calculation you need to anchor a cell reference so that it doesnt move onyou when you copy the formula to other locations. In order to do so, you need to make thereference Absolute so that the cell address does not change. To make a cell reference Absolute, youmust type a dollar sign ($) before the column reference and another dollar sign ($) before the rowreference.

    You can also just press F4 on the keyboard The F4 key lets you toggle between relative, absoluteand two types of mixed cell references.

    If you press Ctrl + ~ (tilde) on the keyboard, Excel toggles between displaying the values andformulas.

    Figure 2

    Notice the cell referencesadjust according to theirlocation when you copy theformula in E5 down thoughE8

    Figure 3

    Notice the first cellreference adjusts accordingto the new row, but thesecond reference isAbsolute (anchored) to H1,the commission value.

  • 7/31/2019 Excel2007 Advanced Calculations

    3/11

    3

    MICROSOFT EXCEL 2007: ADVANCED CALCULATIONS

    About FunctionsFormulas 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 BoxUsing 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 organizedinto categories. You canfind any function in the Allcategory.

  • 7/31/2019 Excel2007 Advanced Calculations

    4/11

    4

    MICROSOFT EXCEL 2007: ADVANCED CALCULATIONS

    About ArgumentsArguments 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).

    The Sum FunctionThe 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: =SUM(B5:B8)

    Example 2: =SUM(B5,C8,D12,E15)

    Figure 5

    This function requiresonly one argument; acell range.

    1

    2

    Figure 6

    The Sum function in this exampleis adding up the numbers in cellsB5 through B8.

  • 7/31/2019 Excel2007 Advanced Calculations

    5/11

    5

    MICROSOFT EXCEL 2007: ADVANCED CALCULATIONS

    AutoSum ButtonSince one of the most common tasks for spreadsheets is to sum a range of values, Excel has aspecial button that helps you do just that. The AutoSum button is on the Formulas tab and also onthe Home tab. As step one, before you click the AutoSum button, it is recommended that you selectthe cell where you want the answer. When you click on the AutoSum button, the Sum function and asuggested range to be added are displayed and highlighted in the formula bar. You can change thisrange 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 usedFunctions such as AVERAGE, COUNT NUMBERS, MAX, MIN.

    AVERAGE FunctionAnother common calculation in Excel is the AVERAGE function (Figure 7, 1). The AVERAGE functionis a Statistical function which returns the arithmetic mean of a list of values. In other words, it addsup 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 FunctionAnother type of statistical function is the MEDIAN function (Figure 7, 2). The MEDIAN functionreturns the middle of a distribution (half the scores are above the median and half are below themedian) of all the numbers evaluated by the formula.

    Basic Concept: =MEDIAN(number1, number2, number3,...)

    Example: =MEDIAN(B6:F6)

    MODE FunctionA third type of statistical function is the MODE function (Figure 7, 3). The MODE function returns themost 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 FunctionA fourth type of statistical function is the COUNT NUMBERS function (Figure 7, 4). The COUNTNUMBERS function counts the total number of cells that contain numbers or data.

    Basic Concept: =COUNT(value1, value2,...)

    Example: =COUNT(B6:B17)

  • 7/31/2019 Excel2007 Advanced Calculations

    6/11

    6

    MICROSOFT EXCEL 2007: ADVANCED CALCULATIONS

    MAX FunctionAnother type of statistical function is the MAX function (Figure 7, 5). The MAX function returns thelargest (maximum) value of all the numbers evaluated by the formula.

    Basic Concept: =MAX(number1, number2, number3,)

    Example: =MAX(B6:B17)

    MIN FunctionAnother type of statistical function is the MIN function (Figure 7, 6). The MIN function returns thesmallest (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 gradeslisted in cells A2 through A8. Each formulaprovides a different statistical answer.

    1 46532

  • 7/31/2019 Excel2007 Advanced Calculations

    7/11

    7

    MICROSOFT EXCEL 2007: ADVANCED CALCULATIONS

    TODAY FunctionThe 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 theopen and closed parenthesis after the function name no argument is needed for this function.

    NOW FunctionThe 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

    1

  • 7/31/2019 Excel2007 Advanced Calculations

    8/11

    8

    MICROSOFT EXCEL 2007: ADVANCED CALCULATIONS

    IF FunctionThe 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)

    Nested IF FunctionA Nested function is simply a function within another function. The result returned from one functionis used as the argument of another function. A nested formula can contain up to seven levels ofarguments 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))

    Figure 9

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

  • 7/31/2019 Excel2007 Advanced Calculations

    9/11

    9

    MICROSOFT EXCEL 2007: ADVANCED CALCULATIONS

    VLOOKUP FunctionThe 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)

    HLOOKUP FunctionThe 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 inthe 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)

    Figure 10

    The VLOOKUP function is looking upthe Avg Score in cell F5 (88%), thenlooks in the Letter Grade Table belowand returns the associated lettergrade in the same row, but in column2 of the table. An Avg Score of 88%returns a grade of B+.

    1

  • 7/31/2019 Excel2007 Advanced Calculations

    10/11

    10

    MICROSOFT EXCEL 2007: ADVANCED CALCULATIONS

    PMT FunctionThe 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)

    FV FunctionThe 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 futurevalue of an investment based on afixed interest rate and constantpayments over time. Only the Rate,Number of Periods and Payment fieldsare required.

    Figure 11

    The PMT function calculates the paymentfor a loan based on a fixed interest rate andconstant payments over time. Only the

    Rate, Number of Periods and Present Valuefields are required.

  • 7/31/2019 Excel2007 Advanced Calculations

    11/11

    11

    MICROSOFT EXCEL 2007: ADVANCED CALCULATIONS

    3D FormulaA 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: =January!D5+February!D5+March!D5

    Example2: =SUM(January!D5,February!D5,March!D5)

    Figure 13

    1

    This 3D Formula calculates a running

    total across the January, February andMarch worksheets using operators, inthis case plus signs.