Lec01 Intro Basics

download Lec01 Intro Basics

of 41

Transcript of Lec01 Intro Basics

  • 8/12/2019 Lec01 Intro Basics

    1/41

    OPIM 529

    Lecture 1

    Can Akkan

  • 8/12/2019 Lec01 Intro Basics

    2/41

    Topics

    Excel basics

    SUMPRODUCT formula

    Conditional Counting and Summing IF, COUNTIF and SUMIF formulas

  • 8/12/2019 Lec01 Intro Basics

    3/41

    3

    MS Excel

    It is one of the most important tools youwill use in your education and work.

    Data analysis

    Average, minimum, maximum spending bycustomers?

    Graphing data (for analysis and presentation)

    Graph of age of customers versus amount spentby them.

  • 8/12/2019 Lec01 Intro Basics

    4/41

    4

    MS Excel

    Simple database functionality

    Find the customers whose income is above$40,000, who are married and have at least one

    child. Developing quantitative models for business

    problems

    Where should I locate my warehouse to minimize

    transportation costs.

  • 8/12/2019 Lec01 Intro Basics

    5/41

    Regional SettingsEnglish (US)

    5

  • 8/12/2019 Lec01 Intro Basics

    6/41

    Example 1

    We enter a formula by first typing = Revenue = Price x quantity sold

    Most formulas refer to a cell by a cell reference Cell reference B5 refers to the price of Mug 1

    6

    Lec1_ex5.mp4

  • 8/12/2019 Lec01 Intro Basics

    7/41

    Example1

    You can copy and paste a formula

    Goto cell D5

    Press Ctrl + C (shortcut for copy)

    Go to cell D6

    Press Ctrl + V (shortcut for paste)

    Select D7:D11

    Press Ctrl + V to paste

    7

  • 8/12/2019 Lec01 Intro Basics

    8/41

    Example 1

    There are formulas to do certain common tasks,e.g. summation

    8

  • 8/12/2019 Lec01 Intro Basics

    9/41

    Example 1

    Now copy the SUM formula and paste it to cellD12.

    You should get the following:

    9

  • 8/12/2019 Lec01 Intro Basics

    10/41

    10

    Example 2

    Type the following:

    Cell B4: Price

    Cell C4: Quantity

    Cell D4: Revenue

    Cell B5: 3

    Cell C5: 5

  • 8/12/2019 Lec01 Intro Basics

    11/41

    11

    Example 2 - Entering a Formula

    Lets calculate the revenue

    Recall: Excel formula starts with =

  • 8/12/2019 Lec01 Intro Basics

    12/41

    12

    Example 2 - Copying Formula

    Lets copy (Ctrl+C) and then paste (Ctrl+V)the revenue formula to

    Cell E5

    Cell D6

    Cell E7

    Press F2 when the cursor is on these cells

    Where are the formulas referring to?

  • 8/12/2019 Lec01 Intro Basics

    13/41

    13

    Example 2 -Relative Referencein Excel Formula

  • 8/12/2019 Lec01 Intro Basics

    14/41

    14

    Example 2 - Copy-Paste theRange

    Copy B4:D5 range to B10:D11

  • 8/12/2019 Lec01 Intro Basics

    15/41

    15

    Example 2 - Using the $ sign inFormula

    In cell D11 type =B$11*$C11

    Now copy-paste the formula to

    Cells E11,D12 and E13

  • 8/12/2019 Lec01 Intro Basics

    16/41

    16

    Example 2 - The Effect of $ InFormulae

  • 8/12/2019 Lec01 Intro Basics

    17/41

    17

    Example 3

    Using SUMPRODUCT

    Go to sumproduct worksheet

    Calculate total revenue

    First, using multiplication and summation

    Then, using SUMPRODUCT

  • 8/12/2019 Lec01 Intro Basics

    18/41

    18

    Example 3

    In a cell if you press the function key F2 you

    Get the display shown below Color coded cell references

    Can edit the formula directly within the cell.

  • 8/12/2019 Lec01 Intro Basics

    19/41

    19

    Example 4

    A retailers data on its customers and theirpurchases. Note the comments entered for each column header.

    Right-click the mouse select Insert Comment

    Note the currency format used for Salary andAmountSpent

  • 8/12/2019 Lec01 Intro Basics

    20/41

    20

    MS ExcelShortcuts

    Knowing certain shortcuts can speed upthe work you do in Excel dramatically.

    Select any cell in the table

    Press CTRLdown arrow, then CTRLright arrow, then CTRLup arrow, etc.

  • 8/12/2019 Lec01 Intro Basics

    21/41

    21

    Example 4

    Task 1: Insert a new column to the left of the

    table and title it "Customer ID". There are at least 2 slightly different ways

    of doing this. Fill the "Customer ID" column by

    numbers 1 through 1000 Fill in the first three entries 1, 2 and 3

    Select these cells

    Double click on the fill handle when thecursor turns into a cross.

    Excel fills in up to 1000 because there is acolumn with 1000 rows next to it.

    Fill handle

  • 8/12/2019 Lec01 Intro Basics

    22/41

    22

    MS ExcelShortcuts

    When the range in a formula is long do notuse the mouse the select it. Use CTRL-SHIFT-arrow

    typically down-arrow or right-arrow SHIFT lets you select multiple cells.

    Similarly when you copy a long range. Select with CTRL-SHIFT-arrow

    Copy with CTRL-C

    Paste with CTRL-V

  • 8/12/2019 Lec01 Intro Basics

    23/41

    23

    Example 4

    Task 2: In cell B2 enter "Average" and then calculate the averages of

    columns C through I in cell C2 through I2. In cell C2 the formula should be =AVERAGE(C3:C1003)

    Then copy the formula (can use drag handle) to the other cells.

    Pay attention to the formats. You can adjust significant digits by the buttons:

    You can copy the format of the currencies by the format painter

  • 8/12/2019 Lec01 Intro Basics

    24/41

    24

    Example 4

    Task 3: Calculate total and average amount spent by male

    customers. Use SUM formula to calculate the number of males

    Use SUMPRODUCT formula to calculate total amount spentby males: =SUMPRODUCT(I4:I1003, C4:C1003)

    Calculate average AmtSpent for males

  • 8/12/2019 Lec01 Intro Basics

    25/41

    25

    Example 4

    Task 4: Copy and paste (in one step) the "Gender","Married" and "Children" columns to columns P, Qand R.

    CTRL lets you select multiple disjoint cells/ranges.

    Use CTRL-Shift-down arrow to select Gender column

    Holding down CTRL key, left-click the mouse on top ofMarried column

    Press CTRL-Shift-down arrow to select Married column

    Do the same for Children column

    Press CTRLC to copy the three columns

    Select cell P3 and then press CTRLV

  • 8/12/2019 Lec01 Intro Basics

    26/41

    26

    Example 5Logical Conditions in Excel

    Video availbale in Media Gallery

    Type the following in cells A1, A2 and A3

    =(1=1)

    =(1 > 3)

    =(3

  • 8/12/2019 Lec01 Intro Basics

    27/41

    27

    Example 6

    Video availbale in Media Gallery

    Data on some households

    Objective: categorize utility expenses asnormal or high

    More than $250 -> high, otherwise normal

  • 8/12/2019 Lec01 Intro Basics

    28/41

    28

    Example 6Simple IF

    Excels IF function

    IF(logical condition, returned value ifcondition is true, returned value if

    condition is false) In cell F3 type

    =IF(C3>$F$1, "high", "normal")

    " " symbols are used to denote that a text(called string in computer science) is beingreturned

  • 8/12/2019 Lec01 Intro Basics

    29/41

    Example 6Simple IF

    Value parts could also have

    Empty Text: =IF(C3>$F$1,"high","")

    Number: =IF(C3>$F$1, 1, 0)

    Formula: = IF(C3>$F$1, D3*C3, (1-D3)*B3)

    29

  • 8/12/2019 Lec01 Intro Basics

    30/41

  • 8/12/2019 Lec01 Intro Basics

    31/41

    31

    Example 6Nested IF

    In cell G3write

    =IF(F3="high",IF(D3=1,1,0),0)

    One can write different nested IF functionsthat do the same job

    Think of alternative ways of doing this

  • 8/12/2019 Lec01 Intro Basics

    32/41

    32

    Example 6AND Function

    Since we have multiple conditions that must beTRUE, we can use the AND function

    First go back to Ex 5 worksheetandin cell A4type=AND((1=1), (1>3))

    Can also write=AND(A1, A2)

    Try above in cell A5 In cell A6, type

    =AND(A1,A3)

  • 8/12/2019 Lec01 Intro Basics

    33/41

    33

    Example 6AND Function

    Now use IF and AND functions todetermine people with bothhigh utility expense and owns her home.

    In cell H3write

    =IF(AND(F3="high",D3=1), 1,0)

  • 8/12/2019 Lec01 Intro Basics

    34/41

    Example 7

    No video in Media Gallery.

    Two useful functions with IF functionality

    COUNTIF(range, criteria)

    SUMIF(range, criteria, [sum range]) Note: parameter in square brackets is optional

    34

  • 8/12/2019 Lec01 Intro Basics

    35/41

    Example 7

    35

  • 8/12/2019 Lec01 Intro Basics

    36/41

    36

    Good Spreadsheet Design

    Useful spreadsheet models should have thefollowing properties:

    Must provide accurate results

    cross-checking, batch totals, breaking down lengthy formulasinto smaller steps can help reduce errors.

    Must be understood both by their creators and users. Clear and complete descriptions, consistent approach to

    layout

    Be adaptable to changes

    Must be efficient for the user to locate and observecritical portions of it

  • 8/12/2019 Lec01 Intro Basics

    37/41

    37

    Good Spreadsheet Design

    Some suggestions:

    Planning saves time and trouble: Before turning onthe computer lay out a tentative structure of the modelon paper.

    Document the worksheet: you should design yourmodel so that six months from now you canremember the purpose of the template and how itworks.

    Color-code input data: We will use blue-background.Might also color-code important outputs, or cellscontaining random functions.

  • 8/12/2019 Lec01 Intro Basics

    38/41

    38

    Good Spreadsheet Design

    Use an effective layout:

    In general a good layout should be vertical ratherthan horizontal.

    Spreadsheet should begin with an identification (adescriptive title, authors name, date of creation).

    Separate areas of different use. Data sectionshould be separate from the work area.

    Description of all constants, variable, assumptionsshould be written.

  • 8/12/2019 Lec01 Intro Basics

    39/41

    39

    Good Spreadsheet Design

    Pay attention to alignment and format:

    Put labels over all columns.

    Use currency & comma formats where appropriate.

    Use an integer format where decimal accuracy isnot needed.

    Arrange all worksheet data in either columns orrows, not a combination of both.

    Each input data should be entered only once. If for clarity purposes it is to be repeated, this

    should be done by using cell references or rangenames.

  • 8/12/2019 Lec01 Intro Basics

    40/41

  • 8/12/2019 Lec01 Intro Basics

    41/41

    Good Spreadsheet Design

    Protect your worksheet from unintendedchanges:

    Use Worksheet and Cell Protection options to

    prevent mistaken entry into or erasure of importantcells.