Você está na página 1de 108

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Page 1

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

CONTENTS

PART I: USING EXCEL EFFICIENTLY

1 AUTO FILL ................................................................................................................................................ 5 2 SELECTING IN EXCEL ................................................................................................................................ 7 Select an Entire Sheet ........................................................................................................................ 7 Selecting a section.............................................................................................................................. 7 Selection Shortcuts ............................................................................................................................. 8 3 FORMULAS, FUNCTIONS AND ADDRESSING ............................................................................................... 10 4 RENAMING CELLS AND RANGES ............................................................................................................... 14 5 SIMPLE CHARTS ...................................................................................................................................... 18 Quick Chart ........................................................................................................................................ 18 Creating a Chart Using the Wizard................................................................................................. 18 More about the Chart Wizard.......................................................................................................... 23 Three Dimensional Charts Column and Pie ............................................................................... 23 Pie Charts ........................................................................................................................................... 24 Bubble Charts .................................................................................................................................... 25

PART II: IF FUNCTIONS AND TEXT MANIPULATIONS

27

6 IF FUNCTIONS ........................................................................................................................................ 28 Simple If Functions ........................................................................................................................... 28 Nested If Functions .......................................................................................................................... 31 Nested If Payroll Example ............................................................................................................ 32 7 TEXT MANIPULATION .............................................................................................................................. 33 Text to Columns ................................................................................................................................ 33

PART III: STATISTICAL TOOL

37

8 DESCRIPTIVE STATISTICS........................................................................................................................ 38 Descriptive statistics ......................................................................................................................... 39 Frequency Distributions ................................................................................................................... 41 9 DATA ANALYSIS ...................................................................................................................................... 46 Descriptive Statistics ........................................................................................................................ 46 Histogram .......................................................................................................................................... 47 10 REGRESSIONS ....................................................................................................................................... 50 Using the Chart Wizard .................................................................................................................... 50 Linear Regression -- Using Excel Functions .................................................................................. 51

PART IV: WHAT-IF ANALYSIS

54

11 GOAL SEEK ........................................................................................................................................... 55 12 SENSITIVITY ANALYSIS AND DATA TABLES............................................................................................. 59 One way Table .................................................................................................................................. 59 Two Way Table ................................................................................................................................. 61 13 USING SCROLL BARS FOR SENSITIVITY ANALYSIS .................................................................................. 63 One More Example: Break-Even-Analysis ..................................................................................... 65 Using the Data Table for the Break-Even-Point Example ........................................................... 67

PART V:

70

14 MULTI PAGE BUDGETS .......................................................................................................................... 71 Going the 3rd Dimension .................................................................................................................. 71

Page 2

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

15 LOOKUP TABLES ................................................................................................................................... 78 Approximate Match Lookup............................................................................................................. 78 An Exact Match Lookup ................................................................................................................... 81

A Payroll Example ............................................................................................................................. 71 A Second Example Bakers Supplies ............................................................................................ 75

PART VI: THE DATA MENU

84

16 SORTING DATA ..................................................................................................................................... 85 17 AUTO FILTER ........................................................................................................................................ 87 18 DATA FORMS ........................................................................................................................................ 89 19 GROUPING AND OUTLINING DATA ......................................................................................................... 91 20 SUBTOTALS .......................................................................................................................................... 94 21 PIVOT TABLES ...................................................................................................................................... 97 PivotTable Example .......................................................................................................................... 97 Datamining with Pivot Tables ....................................................................................................... 101

Page 3

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Part I: Using Excel Efficiently

Part I describes how Excel, the widely-used spreadsheet package, can be used efficiently to help build your spreadsheet for a variety of purposes. As an MBA student, an analyst or an executive you could become a spreadsheets expert. This part of the book has tools for carrying out some common tasks quickly and efficiently. Carrying out different tasks this part will not turn you into an Excel expert in a short time, but by the end you should improve the things you can do - the types of things that make Excel into such an incredibly powerful and flexible tool for modeling, finance statistics and data manipulation. In Part I: Using Excel Efficiently we will cover the Auto Fill, efficient Selecting and highlighting in Excel. You will also learn how to use keyboard selection shortcuts. The next topic covered is how to insert formulas, functions and use absolute and relative addressing. The last two parts are the naming of cells and ranges and how to create simple charts.

Page 4

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Auto Fill

This chapter will demonstrate how to use the drag handle in Excel to fill information. These operations work in all directions; top down, down up, left to right and right to left. Figure 1-1 demonstrates this feature.

Figure 1-1 Select two adjacent cells and release the mouse. When you hover again over the lower right corner (called drag handle), your mouse pointer should change shape to a hair cross (+). You can click and drag down the column and Excel will continue the initial two cell series for you. You can auto-fill several types of data by selecting cells and dragging the drag handle as shown in figure 1-1, including numbers, dates, days, and quarters. For a complete list of your available auto-fill series, go to Tools menu Options Custom Lists (you will see the current lists on your computer.) If needed, you may add your own custom lists. Try the following example shown in figure 1-2. Try to drag down the information shown in columns C and D (are you going to make this an embedded excel spreadsheet). After you experiment with a couple of columns, try a more efficient way: Select two adjacent cells. Release the mouse fore a moment. Go to the drag handle. This time -- DO NOT DRAG double click. Excel will drag it for you. It will complete dragging to the end of the adjacent column to the left. You may try with more that one column at a time. It works only in one direction: down!

Page 5

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 1-2 You may want to show in figure 1-2 all of the columns highlighted with the hair cross on the final column. In figure 1-3 you can see the results.

Figure 1.3

Page 6

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Selecting In Excel

Select an Entire Sheet


To select an entire sheet either use CTRL+A, or click on the gray empty cell between column A and row 1. See Figure 2-1

Click between A and 1 for select all

Figure 2-1

Selecting a section
To select any continuous section, click on the first cell of the section, then shiftclick on the last cell of the section. You can also reverse the process, click on the last cell, then shift-click on the first cell of this section to select. See figure 2-2.

Page 7

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Click here first

Figure 2-2
To select a section without dragging To select a section without

Shift click Second: Shift click here

Selection Shortcuts
To select an area from a cell or cells to the end of the data on the column, select the cell(s) and click CTRL-SHIFT- (Arrow Down.) See figure 2-3.

Select the first cells D3:F3

Click CTRL -SFT-Arrow Down ( ?)

Figure 2-3 To select the entire database, click anywhere in the database and then: CTR+SHIFT+* (asterisks.) See figure 2-4.

Page 8

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Select any cell

CT -SF -* CTR SFT +

Figure 2-4 With larger spreadsheets you may want to go back to the beginning of the sheet or to the end of the data on the sheet. To go back to cell A1, click CTRL+Home; to reach the last cell of the sheet use CTR-End. Also try CTRL+ SHIFT +End to select the sheet from the current cell to the last active cell on the sheet. If you are on a row and wish to be on the first cell of that row: use the Home button.

Page 9

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Formulas, Functions and Addressing

In this chapter we will explain formulas, functions and addressing features. In Figure 1-8 we present a simple payroll. To calculate the salary in cell E2, type the = sign first; then we click on cell C2, type * and then click on cell D2. If we click Enter, the formula will calculate the result, and the cursor will remain in cell E2,. To save an extra step and advance to the next cell (E3), we click on the green check sign (see the circle in the figure). The result is shown in Figure 3-1.

Figure 3-1

Page 10

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

When the operation is completed in cell E2, we are ready to copy/drag down the formula to the rest of the cells on the column -- all the way to E8 (the last cell that has information on the adjacent column.) We do not copy and paste and though you can drag down, it is not the most efficient way (imagine if you had 2000 employees!). We go to the drag handle (on the lower right corner of the cell) and when the cursor/mouse becomes a hair cross (+), we double click and the formula will be transferred to the rest on the cells on column E. See figure 3-2.

+
Double click here her

Figure 3-2 Note: you did not copy the values down, you copied the formula. In figure 3-3 you can see all the formulas. To reveal all the formulas on a sheet choose CTR+` (left apostrophe -- or CTRL+~). Notice that formulas reads =C2*D2 on row 2 and =C3*D3 or row 3, etc. This is called relative addressing. The address is relative to the position of the row and the column.

Figure 3-3

Page 11

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

You may now choose again CTRL+` (left apostrophe -- or CTRL ~) and the formulas disappear --the sheet turn backs to its initial view, showing the values, not the formulas. (CTRL+` acts like a toggle.) The next step on the payroll spreadsheet is to calculate the tax for all the rows. We want to multiply the salaries on column F by the Tax Rate in cell B11 (see figure 1-12).. If we use the same procedure described above, we could calculate the tax in cell F2 and then transfer/drag the formula to the rest of the cells on the column (F.) This creates a problem. Since Excel is using the relative addressing it will multiply F3 with B12, F4 with B13, etc. The cells B12, B13 and the and following cells are empty. See the results and the problem on Figure 3-4.

These cells have a value of

Figure 3-4 (Revealing the formulas in figure 3-5 shows you that using B11 in the formula with relatively addressing causes the rest of the cell in column F to use B12, B13, B14, etc. in the formulas. These cells are all empty and they cause the problem we saw in figure 3-4.

Relative addressing on column F continues with B11 down to B12, B13

Figure 3-5

Page 12

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

To overcome this relative addressing problem, we have to be able to refer to cell B11 in all the following cells of column F. This is called absolute addressing; we want all cells in the series to refer to one cell alone. To do so, we have to change B11 in these cells to read $B$11. This will change B11s status in the following formulas in the column from relative addressing to absolute addressing. In figure 1-14 and 1-15; we want to use absolute addressing for B11 in cell F2. We select cell F2. We type =, click on E2 and type * and click on B11. Before we do anything else, we click the F4 key on the keyboard. The F4 key changes B11 to read $B$11. This again is referred to as Absolute Addressing. When we enter (or click the green check sign for enter) we can double click the lower left corner of F2, and it will transfer the formula to the rest of the cells on the column (or we may drag the formula down.) If you check, all the cells on column F contain the $B$11. See Figure 3-6 and 3-7.

Figure 3-6

$B$11 Absolute Addressing

Figure 3-7 This relative addressing, absolute addressing and partial relative addressing (you havent addressed partial address here you may want to delete that) will be addressed again at the end of this part.

Page 13

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Renaming Cells and Ranges

As you will find out later, naming cells or a range of cells can save you precious time and effort when you use Excel for various calculations, statistics and decision making applications. It saves me over 50% of my time when I use Excel! All the cells in Excel are automatically given a specific name that places them in a specific column and row position (or address.) In many situations you may want to rename a cell or a range of cells to make it easier to refer to the data which those cells or ranges contain. In the following example cell B2 has a value of 15%. We would like to rename this call to be called tax. Select the name box, above column A; type the word tax and click enter. This will name cell B2 to be tax, in addition to its original name/address B2. See figure 4-1. Select the name box and type Now the cell is called tax

Figure 4-1 From now on you may use this new name anywhere in the active book. For example if you type a formula in any cell: =200*tax it will result in the value 30. Using the name box is only one way to name or rename cells or ranges. There are a number of other ways. One way is to use the menu Insert-Name. In the following example we will use the Insert Name menu to rename a range of cells. In figure 4-2 we entered several column headers and row names that will be used to rename a range of cells. (Sales, Cost and Profit in row 2 and Jan through Jun in column B.)

Page 14

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 4-2 Our intent is to rename the cells by the names of the headers and the row names. We would like cells C2:C8 to be renamed Sales and cells C4:E4 to be renamed Feb, etc. This would be done for all the cells in the C3 to E8 range. To rename the cells, highlight the database (CTR+SHIFT+*) and click InsetName-Create.

Figure 4-3 When you select ok on the Create Name menu you named the ranges as Sales, Cost and Profit under the headers and Jan, Feb, Mar, Apr, May and Jun to the right of the months names. To see the different ranges you have created, go to the name box and select any name; the range that it represents will then be highlighted on the data itself. See figure 4-4

Page 15

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Selecting Feb in the name box finds the range

Figure 4-4 Now we can take advantage of these names and ranges. For example, we can calculate the sum of Sales. Without the name you would have to use the formula =SUM(C2:C8). Now you can simply use the formula =SUM(Sales). See figure 4-5

Figure 4-5 Try =SUM(Cost) or =SUM(Feb). Experiment with =SUM(Sales,Cost). Try something else: =Cost Feb. This will result in the in the intersection of the cost and Feb: 40. We will be able to take advantage of this naming convention later in many of our applications and examples. You can use the Insert Name menu to create new names and to delete or modify existing names. Just use Insert Name Define and experiment with this menu. See figure 4-6, the Define Name menu. It allows you to add, change or delete names.

Page 16

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 4-6

Page 17

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Simple Charts

Quick Chart
To get a quick chart from data in Excel, select the data shown in figure 5-1 (CTRL+SHIFT+*) and click the F11 key. It generates a Clustered Column chart on a new sheet (the first default chart).

F1

5-1 [Once you have a chart you can right click on an empty space within that chart and select a different chart type on the short menu.]

Creating a Chart Using the Wizard


Using the chart wizard (or alternatively the menu: Insert Chart) you may create a variety of charts. We will start with simple charts. The easiest way to create a chart is by arranging your data in the way that Excel expects it; namely, try to position the data or names you want on the x-axis (the horizontal axis) on the left most column of you chart data. You may arrange it in different ways but you will have to go through additional steps to create the chart you desire. Using the same data from the previous example, we can create a column chart using the first and second columns data only. Select the first two columns and click on the Chart Wizard. See figure 5-2.

Page 18

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Chart Wizard

Figure 5-2 Select the very first chart type that pops up and proceed by clicking the Next button on the menu. On the left part of figure 1-24 you see the menu that lets you change the data on the chart. If you did not set up the data horizontally rather than vertically, you will have to choose here the Series in Rows, not in columns. The Series Menu on the same window (see the left part of figure 5-3) allows you to add data, remove data or change the values on the x-axis; this will be explained later in the section.

Figure 5-3 When you click on the chart window the Next button you get to specify many of the features of the chart. If you ignore or forget any of the steps, you will still be able to access these formatting options when the chart is already completed. The Title window allows you to enter the labels for the chart header as well as the names for the x and y axis. See figure 5-4. The Axes menu and the Gridlines allow you to specify their attributes.

Page 19

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 5-4 In figure 5-5 you see the other options available on this screen. The legend tab allows you to specify whether you want a legend and if so, where you would like to position it on the chart. The default position is on the right. The Data Labels menu allows showing the values, the series and/or category names on the chart. With the Data Table checked you will have the complete data of this chart shown under the chart itself.

Figure 5-5 The last step in creating the chart is to specify the location of the chart. I chose here As an object: in the same sheet; you may also place the chart on a new sheet.

Figure 5-6 Page 20

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

The end result is illustrated on Figure 5-7.

Figure 5-7 If at some time in the future you wish to change any of the chart features or change the charts location, you may do so by right clicking on an empty space on the chart (see figure 5-8) and a menu allows you to choose your preferences. You may change the chart type, add or delete data within the Source Data, or bring back the Chart Options for the different attributes of the chart shown in the previous figures.

Right click for this menu

Figure 5-8 For this chart, we used the months in the first column for the time on the x-axis and the sales information of the second data column for the y values of the

Page 21

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

chart. If you wish to add the rest of the data to the chart, the cost and profit columns, follow the following steps: Select the data D3:E9, press the Copy icon (or CTRL+C), click anywhere on the chart and press the Paste icon (or CTRL+V) and the data will be added to the chart. See 5-9).

Select the data and press the Copy click anywhere on the and press the Paste

Figure 5-9 All charts in Excel have some common characteristics. All data series (in our example, the sets of columns in the above charts) can be marked the same way. If you click on a column once, all of the columns of the series will be marked (for example, all of the sales will be marked if you click one of the sales columns). If you click on the same column a second time it marks the individual column only. Use the rule: First click marks all of the points (columns) in a series the second click marks the individual point (or column). See figure 5-10. Marking a series this way (first click for all the points and second click for the individual) works in all charts in Excel.

Page 22

Excel For Analysts and MBAs

Isaac Gottlieb, PhD


Second click the individual

First click marked all the in the Sales series

Figure 5-10 If you right click after all of the points are marked you can format the complete series (on the shortcut menu use Format Data Series). If an individual column is marked (after a second click) you can format the individual column by itself (on the shortcut menu use Format Data point). See figure 5-11

Figure 5-11

More about the Chart Wizard


The chart wizard can be used for a variety of charts. This section illustrates a few of these charts.

Three Dimensional Charts Column and Pie


Using the same data, we will create a three dimensional column chart and a pie chart (a three dimension column chart is shown in figure 5-12).

Page 23

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 5-12 This chart is called Clustered column with a 3-D visual effect. If you type the information in columns A and B, figure 5-13, you could get the information desired on the X-axis. The information in columns A, B and C is transferred to bottom of the chart.

Figure 5-13

Pie Charts
To create a simple pie chart, select the data and proceed with the steps of the chart wizard as shown in figure 5-14.

Page 24

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 5-14

Bubble Charts
Bubble charts are a type of XY (scatter) chart that are used to compare sets of three values/attributes. Each data point has two values, and the size of the bubble represents the value of the third. For example, you may wish to chart summary information of sales. You are interested in the relationship between total sales, quantity sold, and the number of unique products (the product mix) that each Sales Representative markets. Unlike most charts, instead of having two variables, you have three. To plot this information on a chart, you can use the size of the bubbles as a visual indicator of the product mix (number of unique products). The larger the bubble, the greater the product mix. Tip: To create a bubble chart, it is best if you select only the data (no labels) and use the second step of the wizard to identify whether the data series is in the rows or columns and which cell contains the name of the data series. Once the chart is created however, each bubble is the same color and the legend doesn't indicate the Sales Rep that is associated with each bubble. With a little bit of tweaking, you can transform this boring, unclear chart into a colorful and (more importantly) easy to understand chart. The example on the following figure, 5-15, illustrates the Bubble Chart.

Page 25

Excel For Analysts and MBAs

Isaac Gottlieb, PhD


Bubble Chart
9 8 7 6 5 6 1

In the first point x=1, y=3, size=3. In the second y=5, bubble size=6. In the point x=6, y=7, bubble

4 3 2 1 0 0 1 2 3 X 4 5 6 7 3

Figure 5-15

Page 26

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Part II: If Functions and Text Manipulations

In Part II we cover two commonly needed skills: The use of the IF functions, which makes Excel a better tool for decision making purposes and the Text manipulation functions. The If function can be used when the information you want in a cell is conditional. If you need to specify two (or more) different answers for a cell based on conditions you specify. For example the hourly rates are different for regular and over time. The commissions rate are lower for less than $10,000, are higher for over $10,000 and are much higher for sales over $30,000. The If function enable you to get the feeling for programming It is similar to the steps you may take if you use a computer programming language without coding. Text manipulation in Excel has some powerful tools. The first part in this part will demonstrate how to separate data confined in a single column spreading it into a number of columns. Data acquired from different sources may come as a text file of may be separated with spaces, commas or other delimiters. You will learn how to separate the data into columns

Page 27

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

IF Functions

Simple If Functions
The IF function makes decision modeling more efficient. When decision makers and analysts must take into account complex models, it enables them to consider more than one alternative. The IF function in Excel first answers the question: Is this true or false? and then proceeds to take action based on the answer. The If function has three parts/arguments: Logical test -- what are we asking? Or what is the question? Value if true -- what do we want displayed if the answer to our question is true? Value if false-- what do we want displayed if the answer is false? The syntax or the structure of the If function is as follows: =IF(logical test, value if true, value if false). Within the parentheses you create the three parts/arguments separated with a comma (,). You can rewrite it as =IF (condition, action or value if condition true, action or value if condition false) We can start with a simple example: In figure 2-1 we have two groups of numbers (1 and 2) and we want to point out the numbers in group 1 that are larger than the ones in group 2 on the same lines/rows. We want to type yes when they are larger and no when they are not. We use the If function to do so.

Figure 6-1 We insert the If function in cell C2: =IF(A2>B2,"yes","no") The If function in cell C2 has three parts: The logical test A2>B2. The value if true yes

The value if false no

Page 28

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 6-2 For cell C2 the result should be no. See figure 6-3.

Figure 6-3 For cell C3 the result should be no since the value in A3 is equal to the value in B2 -- not greater. The rest of the results are shown in figure 6-4. The left side of figure 2-4 reveals all the formulas, using CNTR+` (left apostrophe). The right side shows the results.

Figure 6-4 In the next example we illustrate how to use the If function to calculate regular time and overtime in a weekly payroll. Employees salaries are calculated the following way: If an employee worked up to 40 hours a week, the salary = Rate x Hours worked, otherwise we calculate his salary for the first 40 hours to be Rate x 40, plus one and half times the rate for the hours worked over 40 (Hours worked 40.) In E3 we have the following function: =IF(D3<=40,C3*D3,40*C3+(D340)*1.5*C3) The If function in cell E3 has three parts: The logical test D3<=40. Regular time only?

Page 29

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

The value if true: C3*D3. Regular time only. Rate X Hours worked. The value if false: 40*C3+(D3-40)*1.5*C3. 40 X Rate + Overtime X 1.5 X Rate.

Figure 6-5 We can use the Excel Functions menu, fx to do the same thing. See figures 6-6 and 6-7.

Figure 6-6

Page 30

Excel For Analysts and MBAs

Isaac Gottlieb, PhD Figure 6-7

Figure 2-8 shows the result on the left. When you double-click the drag handle in results in the function dragged (copied) all the way to the end of the adjacent column, as shown on the left side of figure 6-8.

Figure 6-8 Figure 6-9 reveals all the formulas, using CTRL+` or CRL+~.

Figure 6-9

Nested If Functions
In many cases you may want to have more than the two choices offered with the simple If function. For example if you want to enter letter grades for students depending on their achievement on a test: A for 90 and up, B for 80 and up, C for 70 and up and D for 60 and up. Otherwise they fail and receive an F. Here are the details of that request: Page 31

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

If If If If If

A1 A1 A1 A1 A1

contains a value of 90 or more, then we want to have an A in B1. is between 80 and 89, then you want a B in B1. is between 70 and 79, then you want a C in B1. is between 60 and 69, then you want a D in B1. is less than C, then put an F in B1.

To do so you have to enter the following formula in cell B1: =IF(A1>=90,"A",IF(A1>=80,"B",IF(A1>=70,"C",IF(A1>=60,"D","F")))) Note how the last option F is there only after the other four Ifs have failed. The maximum number of nested if in one formula is 5.

Nested If Payroll Example


Using the same payroll example, we can extend it to have a nested If function as follows: If an employee worked up to 40 hours, we pay him the regular rate If he worked over 40 but less than 60 we pay him 1 times for the overtime If he worked over 60 hours, we pay him 1 times for the overtime for the hours between 40 and 60 BUT we him pay him 2 times the rate for the hours he worked over 60. Figure 6-10 and 6-11 illustrate the above example. This example has two If conditions:

When the are less than

When the hours are 40 but less Figure 6-10

When the worked are

Page 32

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 6-11

Text Manipulation

Text to Columns
You may either get information where all the data is in one column or receive text files which have the same problem; when you open the file all the data is condensed in a single column. Excel has a feature that enables you to separate the data into individual columns. Look at the data on the sheer shown in figure 7-1. The cells in column one contain all the information that should be spread out over a number of cell.

Figure 7-1 You can see, in the formula bar that all the information in cell A3 Alfano,Vincenzo,17.4,38.3. We could use the command Data>Text to column Page 33

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

to separate the data into individual columns. Note that the data, in the cell, is separated with commas (we call it delimited). The process is done through the menu. See Figure 7-2. We select column A and activate the menu.

Figure 7-2

Figure 7-3

Page 34

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 7-4

Figure 7-5

Page 35

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 7-6

Figure 7-8

Page 36

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

PART III: Statistical Tool

Statistics are needed to make better and informed decisions, quantify markets, identify important trends, answer questions for strategic planning, support key business proposals with hard data Statistics in Excel provides you with is a toolbox of tools that enables you to solve and sort out a variety of problems. We cover in this part descriptive statistics and simple regressions. Two approaches can be taken is solving the problems of descriptive statistics. The first one is to use the built in functions. The second one is to use the Excel Add-in the Analysis Tool Pack. Both methods will be covered. We will also show the two different methods for regressions: The built is functions and the Excel Add-in the Analysis Tool Pack.

Page 37

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Descriptive Statistics

In this section we will discuss statistics. We will start with a statistical analysis of the data on the sheet called statistics in the Excel workbook called Part 3.

Figure 8-1 The data in column one contains a list of 500 students IQs. We have renamed the range A1:A500 DATA. If you expand the name box above A1 by clicking the arrow to the right of the field and then select the renamed DATA set, it will highlight the range of renamed cells. We have also prepared a set of bins on the same page. The BINS are the upper boundaries of each group of the frequency distribution we would like to create. We choose the highest BIN value according to the highest value in the data: MAX and the lowest value jest above the lowest MIN. We try to have 5 to 15 bins according to the statistics we want to obtain.

Page 38

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Descriptive statistics
In this section we are going to calculate several frequently used functions. We will calculate the mean, the highest value, the lowest value, the standard deviation, the median and the mode. See figure 8-2

Figure 8-2 We will begin with the average. We shall select the cell where we would like the answer to be located, and then select fx (function), category: Statistical, function: Average in cell D2.

Figure 8-3 A window requesting function arguments will appear. As wed like to compute the average of our data set, we could highlight A1:A500, but since we previously

Page 39

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

named that range DATA, we can simply type in DATA and click OK to obtain the average.

The result is shown in figure 8-5

Figure 8-4

Figure 8-5 We repeat the process on the same sheet using the fx functions for the MAX, MIN, MEDIAN, STDEVP and the MODE. We use STDEVP as we would like to compute the result for a large population; in this example, we have 500 values. If it was a small sample (<30) we would have use STDEV. The results are shown on the next figure. Figure 8-6 contains the results on the left and reveals the formulas on the right.

Page 40

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 8-6

Frequency Distributions
In this part we will describe how to obtain and chart the frequency distribution of a data set. We have created a list of header bins in column F which will be used to establish the boundaries of the groups we wish to form. In other words, each one of these bins represents the upper limit of the group frequency. In the descriptive statistics section, we established that the lowest number, or Min, is 61 and the highest number, or Max, is 129; we have thus created bins that will encompass this range. We used 70 as the first number in order to count all of the numbers/values below 70 (and above 61 the lowest number). We used 130 as the upper limit of the highest group since the largest number found was 129. The rule of thumb is to find the range of values and to create anywhere from 5 to 15 bins. We have chosen to use 7 in this example. We type the word Frequency in cell G1 and we select the range G2:G8. This is where the results of the frequency distribution will be entered using Excel. We choose to insert a function, fx, category: statistical, function: frequency. The navigation is shown in Figure 8-7.

Figure 8-7 Page 41

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

We type DATA in the Data_array cell in the Function Arguments window (or if we did not name the range DATA, we could select or type A1:A500). See figure 8-8.

Figure 8-8 Since we would like to get the answer in more than one cell (cell G2:G8) to correspond to the set of bins we have selected, this operation/function is called an array operation or function. A simple OK or cursor Return will result in a single cell reply in cell G2. We would like to know the frequency of each of our bins and thus require an answer in the entire range G2:G8. To do so we have to do two things at the same time. Select the range G2:G8 for the Bins_array cell in the Function Arguments window. Hold the CTRL and SHIFT buttons together and while they are pressed click the OK button. This will calculate the array result in the range G2:G8. The array result cannot be changed if you visit any one of the calculated frequency cells in column G you will see how the result appears to have curled brackets. {=FREQUENCY(DATA,F2:F8)}

Page 42

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

The results of the frequency distribution are shown here. BINS Frequency 70 80 90 100 110 120 130 3 11 78 167 184 49 8

Most of the data is distributed around the average (99.21) or the center of the distribution. We would also like to create a chart of the frequency distribution using the information in the range F1:G8. We select the range and use the chart wizard. We choose the first menu, the default menu of a clustered column chart and click on next button to proceed to the next menu as shown in figure 8-9.

Figure 8-9 As demonstrated in the right window of figure 8-9, Excel attempts to create columns for the both the bins and the frequency. We wish to have the bin values as our X-axis values and not as part of the data. To remove the bins and to force the bins values to appear on the X-axis we have to select the series tab. We select the BINS item in the series window and select remove. See figure 8-10 (Steps 1 and 2).

Page 43

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 8-10 We then click on the Category (X) axis labels and select the bins values (F2:F8) from our spreadsheet to get the correct values to appear on the chart.

Figure 8-11 We can then remove the gaps between the columns on figure 8-11. We right click on any of the columns and select format data series. We select Options and remove the gap by setting the gap with to 0.

Page 44

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 8-12

Figure 8-13

Page 45

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Data Analysis

Excel has several add-ins that are useful in a business environment. One of the add-ins is called Data Analysis or when you have to install it, it is called Analysis ToolPack. The ToolPack contains a variety of statistical functions we will demonstrate a couple of them here.

Descriptive Statistics
We are going to calculate the same set of statistical functions one more time using the Data Analysis add-in. First we select the menu item: TOOLS: Data Analysis. If this feature does not exist you must install it. Select Tools, Add-ins and select the Analysis ToolPack. You may be prompted to insert a CD-rom before the installation will be completed. Once you have installed the Analysis ToolPack, the Data Analysis function will be available for selection. When you choose the Data Analysis the following menu will come up:

Figure 9-1 We will select the Descriptive statistics. For the input range, we use our DATA set by typing DATA or by selecting A1:A500. We then check off the last four boxed on the bottom left and click OK. See figure 9-2 for the menu and the results.

Page 46

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 9-2
Mean Standard Error Median Mode Standard Deviation Sample Variance Kurtosis Skewness Range Minimum Maximum Sum Count Largest(1) Smallest(1) Confidence Level(95.0%) 99.218 0.444522 100 102 9.939823 98.80008 0.627105 -0.2154 68 61 129 49609 500 129 61 0.873365

Histogram
We can also calculate the frequencies and create the frequency chart using the Histogram feature of the Analysis ToolPack. We choose Tools: Data Analysis and select histogram On the menu we type DATA for the Input Range and select F2:F8 (the bins area/range). The only selection needed is the last box on the bottom left Chart Output. It will create the results we wanted.

Page 47

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 9-3 You may want to modify the results of the chart.

Figure 9-4 Figure 18 describes the three steps needed.

Page 48

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 9-5

Page 49

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

10

Regressions

We can use Excel to calculate the parameters of a regression line. In part three under the sheet named regression we have a set of data that will be used to demonstrate this feature of Excel.

Using the Chart Wizard


In the first part we will use the chart wizard. Select the Month and Sales data and choose the chart wizard as shown in figure 10-1. Use the xy Scatter plot.

Figure 10-1

We can then add a regression line by right clicking on any of the points in the chart and selecting Add trendline. Under the options we check off the last two boxes to display the trendlines equation and R2 value.

Figure 10-2

Page 50

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

This will result in the chart shown in figure 10-3. The equation of the regression line is reversed. It is Y = - 4.3455 + 4.8727X . The Slope is 4.8727 and the Intercept is -4.3455. R2 is 0.9945.

Figure 10-3

Linear Regression -- Using Excel Functions


We can also calculate these three values using Excel functions. We can use the functions INTERCEPT, SLOPE, RSQ (for R square) and FORECAST. The first thing you may want to do is to rename some cell ranges. It will make it easier to use the various functions without selecting the ranges again every time you want to calculate one of the parameters. We select cells B2:B11 and name it X. We select cells C2:C11 and name it Y. We write the function names we are about to calculate on the regression sheet as shown on Figure 10-4

Figure 10-4

Page 51

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

We use the function (fx), Statistical, Intercept to calculate the intercept point in cell F2. We use the function (fx), Statistical, Slope to calculate the slope in cell F3. We use the function (fx), Statistical, RSQ to calculate the r2 value in cell F4. See figure 10-5. Notice that we used X and Y for our Function Arguments. It saves us the trouble of selecting the ranges of cell again and again.

Figure 10-5 We can also use the results obtained to forecast Y values. We may use it for month 13: Y= - 4.345 + 4.8379 x 13. What we do want to do is calculate the forecast for month 13 (14 and 15) by using the FORECAST function, as shown in figure 3 24. In the X field, we enter the data point for which we want to predict the value; in this case cell B12, for the 13th month. The result is 59. The formula can be dragged down to cells C13 and C14, resulting in the forecast for the following months.

Page 52

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 10-6

Page 53

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

PART IV: What-if Analysis

What-if analysis allows us to find out what will be the impact of change. Change of input, change in assumptions, and change of data or incremental modification of key values. This part will show you how to take advantage of these tools on the decision making process. We demonstrate features such as the goal seek, data tables (one and two way tables) and the efficient use of scroll bars. Goal Seek allows you to change one variable at a time in the decision models you build in spreadsheets. You can gain insight on the impact of goal on inputs. You will find out what should the input be if you wish to reach a certain goal. Data Tables enable you to check the incremental change of certain input values on the decisions. You can change one or two variables simultaneously and watching the impact of these changes on your decisions. We also introduced the use of scroll bars. These scroll bars allow examining changes in more than two variables.

Page 54

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

11

Goal Seek

What-if analysis allows the user to test the impact of changing values in certain cells on the outcome of a model. This section describes a number of what-if analysis procedures. We will start with the Goal Seek and continue with the Data Table and demonstrate their use in a loan example.

Figure 11-1 Consider the following example. You are purchasing a car for $22,000. You are required to pay $4,000 as a down payment. The annual interest rate is 8.00% and the loan period is 3 years. Assume end of period monthly payments. The following is the model created for this loan. See Figure 11-1. First, we rename the cells in column B (B1:B9) to reflect the names in the adjacent cell on column A (this procedure was described in PART 1 and is reviewed below). To create these names we select cells A1:B9 and use Insert Name Create, as shown on figure 11-2. This will create new cell names. For example B2 will be called Price and B4 will be Loan. We use these names to simplify the use of formulas and to avoid the problems caused by absolute addressing. Also, when you return to the model in the future it will be much easier to figure out what were your intentions when you created it.

Page 55

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Select A1:B9 and use Insert Name Figure 11-2 We enter the data into the model. The formula for the Loan amount is =Price-Down_Payment. (Figure 11-3) Do not type 18,000 into the Loan field; it is necessary to have a formula in the cell for our sensitivity analysis to function correctly.
Item Purchased Price Down Payment Loan Rate Years Payment Total Payments Total Interest 8.00% 3 $ Car $ 22,000.00 4,000.00 =Price-Down_Payment Item Purchased Price Down Payment Loan Rate Years Payment Total Payments Total Interest $ Car $ 22,000.00 4,000.00 8.00% 3 $ 18,000.00

Figure 11-3 To calculate the Payment amount we use the financial function called PMT, which returns the periodic payment for an annuity. (The Excel menu defines it: calculates the payment for a loan based on a constant interest rate.) Figure 11-4 shows this function. Note that we use the Rate/12 and the Years*12 since we are calculating monthly payments. Also we use Loan (minus Loan); this is part of Excels requirements of the Loan function. The following figure (11-4) illustrates the PMT function.
Click here for the function

Choose Financial and PMT

Figure 11-4 Page 56

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

The calculation gives a monthly payment of the loan is $564.05. We then calculate the last two cell values B8 and B9. For the Total Payments we used =Payment*Years*12 and for the Total Interest: =Total_Payments-Loan. The results are shown on the left side of figure 11-5. When you use CTRL+` (left apostrophe), we can see all the formulas of the sheet. These formulas are shown on the right side of figure 11-5.
The values and the formulas
Item Purchased Price Down Payment Loan Rate Years Payment Total Payments Total Interest $ $ Car $ 22,000.00 4,000.00 8.00% 3 $564.05 $ 20,305.96 2,305.96 $ 18,000.00 Item Purchased Price Down Payment Loan Rate Years Payment Total Payments Total Interest Car 22000 4000 =Price-Down_Payment 0.08 3 =PMT(Rate/12,Years*12,-Loan) =Payment*Years*12 =Total_Payments-Loan

Figure 11-5 Goal Seek is used to check what would happen to an input or an assumption if we wanted the end result to be different from the result obtained. In our example we would like to adjust the monthly payment of the $564.05 to obtain a different solution. If, for example, we could not afford the amount of $564.05 and we could pay $530 a month. We use Goal Seek to check various possible inputs: We can try and purchase a less expensive car We can try to pay a higher down payment We may negotiate a lower interest rate We will start with purchasing a less expensive car. We select the Payment cell and select Tools Goal Seek. See figure 11-6.

Page 57

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Try $530 and By Changing cell use B2

Figure 11-6 If we try it, the Goal Seek tells us that we could, under these circumstances, purchase a car for $20.913.26 (see figure 11-7). We can cancel the Goal Seek and try it again. We can use, for the changing cell, the down payment. For example, we can try adjusting the number of years it will take to pay off the car in order to achieve our goal of a $530 monthly payment.

Figure 11-7 In figure 11-8 we check the impact of paying only $530 a month on the interest rate. You can see that the desired interest rate to meet our goal is 3.8%.

Figure 11-8

Page 58

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

12

Sensitivity Analysis and Data Tables

One way Table


A Data Table is a range of cells that shows how changing certain inputs in your model affect the outcome. A Data Table provides a tool for recalculating multiple versions in one operation while showing them together on your worksheet. Using the same car loan example, we will explore the impact of some of the inputs to the model on the results. The inputs may be the price, the number of years, the interest rate, etc. The results/output may be the payment, the total payments or the total interest. In the first example we investigate use a Data Table to complete our sensitivity analysis using the interest rate. The initial model has a rate of 8.00%. We could try a range of rates from 3% to 12%. (Figure 12-1.) We first must arrange the table; in this example, the range of rates is placed down the column to the left of the planned table. We are going to investigate the impact of these changes in the rate on the last three output items on the sheet in cells B7:B9.

Figure 12-1 The rest of the table is set up to the right of the rates column. We start with cell E1. We will type = and select cell B7 (or the so called now: Payment); you then click enter to transfer the information to that cell (see figure 12-2)

Page 59

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 12-2 We repeat this procedure for the values in cells B8 and B9. In cells F1: type = and select B8 (or Total Payments.) In cell G2: type = and select Total Interest (B9). The results are shown in figure 11-11.

Figure 12-3 The Data Table will then be filled with the desired sensitivity analysis results. The first step is to select the area of the table (use the shortcut CTRL+SHIFT+*). The second step is to select the menu item Data Table. See figure 12-4.

Figure 12-4 In the Table menu, on the right side of figure 12-4, select the Column input cell (remember, the input data -- the Rate, is changing down the column) select cell B5. This will result in the desired sensitivity analysis table of figure 12-5. Note how the row that belongs to the rate of 8% matches the results of the original model.

Page 60

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 12-5 You may repeat this process and create similar tables; for example, you could check the output when the number of years change or when the price of the car changes. See figure 12-6.

Using the Data Table with the number of years and the price

Figure 12-6

Two Way Table


In the last three tables we saw how we can vary, on the column, one of the inputs (interest rate, the number of years or the price) and view, in the table, the impact of this input change on the outcome (this is the sensitivity analysis or the what-if analysis.) We can also vary two inputs and view their impact on one output. This is called a two way sensitivity table. In the following table we vary two inputs: the number of years on the row side and the interest rate on the column side; and observe their impact on the monthly payments. In the following figure we list the rates (on the column) and the number of years (on the row) while the payment is at the intersection of the two (top left cell of the table.) In cell I1 we have =Payment, and the value $564.05 is displayed. Below the Payment value we list the interest rates. To the right of the Payment we list the number of years. This time when we use the Data Table we input entries in both cells of the menu: the row input cell and the column input cell. For the row input cell we click on the number of years (of the original model in cell B6) and for the column input cell we click on the cell with the original interest rate (cell B5). See figure 11-15 for the resulting output. Note the original payment value in the cell corresponds to the intersection of 3 years and 8% interest. Page 61

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 12-7

Page 62

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

13

Using Scroll Bars for Sensitivity Analysis

Scroll bars were created in Excel for changing values in forms. We are going to use them to change input values in the models, analyzing the impact of the changes on the output. The first value we are going to link to a scroll bar is the number of years. To create the scroll bar go to: View, Tool Bars and select the Forms Tool Bar. On the Forms tool bar select the Scroll Bar. See figure 13-1. When you select it, your mouse pointer will become a thin hair-cross (+) and you can drag and draw with it the desired shape of a scroll bar. We chose to draw the scroll bar next to the number of years on cell B6, since it is the first cell that we want to control with it. (Since we cannot mark the scroll bars, it is best to position them next to the cells that they will control.)

Figure 13-1 The scroll bar is now next to the number of years. We are going to alter some of its parameters. Right-click on the scroll-bar: Choose Format Control the last entry on the menu in figure 13-2. On the new Format Control menu we enter the values we want to control.

Page 63

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 13-2 On figure 13-3 you see the Control tab part of the Format Control menu.

Figure 13-3 We fill all the entries in the form: Current value is the value we would like to control (3, the number of years) The Minimum and Maximum values are the range of values to control Incremental change is the incremental change any time you click on the arrow Page change is the incremental change when you click on the gray area between the arrow and the center scroll bar. Figure 13-4. When you complete the form and click OK you have to click on any cell and then you may you the scroll bar.

Page 64

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 13-4 We created an additional scroll bar for B2 with values ranging from 10000 to 30000 with increments of 500 and an incremental change of 2000. Figure 13-5. This will control the price. Try it!

This scroll bar will control the price in cell B2

Figure 13-4

One More Example: Break-Even-Analysis


The Break-Even point is the condition when the investment or the venture starts making money or the first time the profit is not negative (we are not losing money.) In the following example we repeat the sensitivity-analysis or the whatif analysis features described above. Consider an example: The number of units sold per year is 5,000 at $15.00 per unit. The total revenue is $75,000. The annual fixed costs (such as rent, administrative costs, marketing, salary, etc.) are $90.000. The variable cost is Page 65

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

$5.00, and with 5,000 units sold the total variable costs is $25,000. With Total Expenses of $115,000 and Revenues of $90,000 the net operating income (profit) is negative -40,000. See figure 13-5. (We renamed all the cells on column B.)

Figure 13-5 We will use the Goal-Seek feature to find the Break-Even-Point. We can try to adjust our other variables to find out what is needed to break even: The number of units The unit price The fixed cost or The variable cost per unit. First lets try the number of units. The break-even- point we tried in figure 13-6 was 9,000 units.
We are looking for the number of units sold to make the operating income = 0

Figure 13-6

Page 66

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Second we can try and use goal-seek for the break-even selling price. The Changing cell will be the price per unit cell in figure 13-7. The resulting value, when you try it is $23.00. This is the break-even point when the net operating cost is $0.0.

Figure 13-7 The goal-seek with the Fixed Costs results in a value of $50,000. When you try the goal-seek with the variable cost per unit it will be a negative value: $3.00 Try it!

Using the Data Table for the Break-Even-Point Example


We can investigate the impact of the number of units sold on the Total Revenues, Total Expenses and the Operating Income. We use the DataTable. As we did before, we have to transfer the three values to the top of the table. Type the titles on the first row they will be used later for the chart. Type the units sold values in column D (see figure 13-8.)

Figure 13-8 What must you do to transfer the values to the top of the table? As you remember, we have to select cell E2 and type = and click on B4, the Total Revenues. The same must be done with the other two values: Total Expenses and the Operating Income. Page 67

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 13-9 demonstrates how it is done.

Figure 13-9 Next we use the Data Table feature. The value changing on the column is the number of units sold. The menu is shown in figure 13-10. B2 is the Column input cell since it is the value that changes on the column: number of units sold.

Figure 13-10 Figure 13-11 shows the final result. As expected the Break-Even point is: 9,000 units.

Page 68

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 13-11 When you select the table D1:G3 (use CTRL+SHIFT+*), you can use the chart wizard XY Scatter, (Scatter with data point collected by lines) to create the BEP chart. An interesting exercise for you would be to create a scroll bar. This scroll bar should control the price per unit from $10 to $20. This will also animate the chart; you will be able to see how the Break Even Point changes on the chart itself as you scroll the bar.
$250,000

$200,000

$150,000

$100,000 Total Revenue Total Expenses Operating Income

$50,000

$0 0 ($50,000) 2000 4000 6000 8000 10000 12000 14000 16000

($100,000)

Figure 13-12

Page 69

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

PART V:

Two topics are discusses in Part V: Multi page systems and lookup functions. Most Excel users either keep their entire model or information on one worksheets or when they use a number of sheets they do not take advantage of structuring the system so that can use Excel more effectively. The first portion of this part will cover this topic. In the second portion of this part we discuss lookup functions. We will demonstrate how to perform an exact lookup and how to perform range lookups.

Page 70

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

14

Multi Page Budgets

This chapter will be using Excel with more than rows and columns. We will use rows columns and sheets.

Going the 3rd Dimension


So far in most spreadsheets we used rows and columns only. Now we are going to use a third dimension, sheets. You may want to prepare Payroll reports for four or five weeks on separate sheets and sum the sheets (the third dimension) into the last sheet for a summary. Other examples may be include summing four quarters sheets into an annual report, inventory reports of different locations consolidated into a corporate inventory report and a summary budget of a number of departments. This part will illustrate the preparation of a number of sheets (identical in format), adding information to the different sheets and finally summing them, the third dimension, into the summary sheets.

A Payroll Example
We are going to organize our monthly payroll report for five weeks on separate sheets. When we have the data for the five weeks we are going to sum the data into the Totals sheets. First we are going to format six sheets, one for each week and one for the Totals on an Excel work book as templates. Open a new workbook and add new sheets SHIFT+F11, making the total number of sheets, six. Rename the sheets to be Week1, Week2, Week3, Week4, Week5 and totals. See Figure 14-1.

Figure 14-1 Since most of the information and formatting on all six sheets will be the same, we want to select all six sheets together. When we select all the sheets we can enter the data simultaneously. Click on the sheet Week1, hold the CTR button Page 71

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

and click to select each and every one of the other sheet tabs. All the sheets are selected. When you enter data or format, it will enter the data, the formats and the formulas on all sheets. Notice that the Excel Workbook name indicated the sheets are grouped and that all the sheets are selected. See figure 14-2.

Figure 14-2 We are going to enter the information in the book. It will appear on all the sheets.

Figure 14-3 In figure 14-3 you can see the information formats and formulas that will appear on all six sheets. We chose to enter 0.00 for the hours worked. The data will be entered separately on each weeks payroll. We will also sum the salaries as you can see on figure 14-4.

Page 72

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 14-4 All six sheets will be identical. If you click on one or two sheet tabs the group will be released and you will see the same information, data, formulas and formats on all of them. The next part is to enter the hours worked for each one of the five weeks. This data is display in figure 14-5. As you enter the hours worked the formulas will calculate the salaries and the totals.

Figure 14-5 The critical part is drilling vertically through all five sheets and summing the information on the last sheet the totals sheet.

Page 73

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 14-6 We will sum the hours of the first employee, Vincenzo Alfano, for all five weeks into the Totals sheet. We will select cell D2 on the Totals sheet and sum the hours worked for Vincenzo Alfano from all the above sheets. At this point click the auto-sum icon . Click on the Week1 sheet tab. Your formula bar will read =SUM(Week1!). Next SHIFT+ click the Week5 sheet tab. Your formula bar will read =SUM('Week1:Week5'!). This indicates that you are going to sum the values from week1 to week5. The only thing you have to add is the cells you want to sum on these sheets D2. Click on D2 and the formula bar will read =SUM('Week1:Week5'!D2). When you hit enter you will get the desired sum. The sum of the hours Mr. Alfano worked on the five weeks is 148.00. The salary is computed for the month.

Figure 14-7

Page 74

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

When you drag the values down it will complete the information for the rest of the employees .

Figure 14-8 Note all the formulas on the sheet (using CTR + ~) on figure 14-9

Figure 14-9

A Second Example Bakers Supplies


Good Taste Bakers Supplies has three sales centers in Chicago, New York and Boston. The sales manager in the companys headquarters wants to sum the sales information of the three locations. In the Excel workbook, Part 5 3D a.xls, we prepared four sheets similar in format and structure containing the information in the three sites and a company sheet. Figure 14-10 shows one location (of the three) and the summary sheet.

Page 75

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 14-10 In the summary sheet we are would like to sum the information of the three locations. We select cell B5 in the companys sheet and we will sum the other three sheets cell B5 into it. When B5 is selected we click on the auto-sum icon . We proceed by click on the first sheets tab - Chicago. The formula bar will read =SUM(Chicago!). We SHIFT + click on the last sheet tab we want to include in the sum Boston. The formula bar will read =SUM('Chicago:Boston'!). When we click the B5 cell it will sum all the B5 cells from the Chicago through the Boston sheets. The formula bar will read =SUM('Chicago:Boston'!B5). We can drag the result down to transfer the formula to the rest of the cell in column B.

Figure 14-11 See figure 14-12 and 14-13 for the results.

Figure 14-12

Page 76

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 14-13

Page 77

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

15

Lookup Tables

Lookup tables are a good way look up information and returning desired data based on the information you introduce. The lookup function is a quick way to find the information we need. In this section we will introduce a vertical Lookup table in two formats. The first one when we are looking up data in a certain range and in the second format when we request an exact lookup. When we create a vertical lookup table; the left column of the table is the where we store the information we want to look up (the first column contains the unique values on which we base the lookup.)

Approximate Match Lookup


We will stat with an example of assigning grades to students based on their scores on an exam. The table, figure 15-1, indicated the range of values for exam grades. The left column has the scores and the other two columns specify the grades. The letter grade is in the second column and the grade (as a word) is in the third column. This table does not need an exact match. For example, any score that equals to 66 or higher but lower than 76 will result in a grade of C or Satisfactory. This is not an exact match.

Figure 15-2 In figure 5-14 we show students and their exam scores. We want to look up their scores in the table and assign them the appropriate grades.

Page 78

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 15-4 The lookup table of figure 15-5 is in the range of H2:J6. The first step is to name the range. We will call it Table as you can see in figure 5-15.

Figure15-5 Now we can use the VLOOKUP function, the last function under the Lookup & Reference functions.

Page 79

Excel For Analysts and MBAs

Isaac Gottlieb, PhD Figure 15-6

We are planning to lookup the score in cell C2 in the table: lookup_value: The value you want to look up. In this example, the grade in cell C2. table_array: is our lookup table. We called it Table col_index_num: Which column, in the table has the value you want? 2: the second column of the lookup table. [range_lookup]: Do you want an exact match? Is an approximate match okay? If you use TRUE as the last argument, or omit the last argument, an approximate match can be returned. WE DO NOT WANT AN EXAC MATCH.

Figure 15-7 Once you obtain one grade you may copy, drag down the results to the rest of the students (or double-click) as you can see on figure 15-8.

Page 80

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 15-8 We will use this function again to obtain the Grades in column E. This time the col_index_num is 3: the third column in the Lookup table.

Figure 15-9

An Exact Match Lookup


When we require an exact match of the values we look up we need to indicate, in the last argument of the lookup table, that we do not want an approximate value. We enter the false to indicate it. In the following example we want an exact match in the table.

Figure 15-10 First we name the range E2:H20 to be Range:

Page 81

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 15-11 Now we can use the table to lookup the desired values.

Figure 15-12 In figure 15-12 we lookup the salaries in the table based on SSN. lookup_value: The value you want to look up. In this example, the SSN is in A2.

Page 82

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

table_array: is our lookup table. We called it Range col_index_num: Which column, in the table has the value you want? 4: the forth column of the lookup table. [range_lookup]: Do you want an exact match? Is an approximate match okay? If you use TRUE as the last argument, or omit the last argument, an approximate match can be returned. WE DO WANT AN EXAC MATCH. We used false.

Figure 15-13 Please repeat this exercise and use an exact match of the VLOOKUP to insert the last names in column C. This time the col_index_num is in 3. Compare your results to figure 15-14.

Figure 15-14

Page 83

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

PART VI: The Data Menu

This part will deal with the Data Menu features of Excel. We will discuss Sorting data Filters Creating and using Data Forms Grouping Data Subtotals and Pivot Tables In order to use lists or tables in Excel First you must set up a list. The first row must contain headings. The list can have any number of columns and any number of rows. There should not be a blank row or column in the list. If the list doesn't start in row 1 you must have a blank row above the headings. If the list doesn't start in column A, you should have a blank column to the left of the list

Page 84

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

16

Sorting Data

The table in figure 16-1 is sorted by the employee number

Figure 16-1 If you wish to sort the table by age, you have to select one cell in the age column and click on the sort A to Z icon. See figure 16-2.

Figure 16-2 You may use the A to Z for ascending and Z to A for descending order. You can try any one of the columns. It will sort the entire table using the parameter/column you choose. If you wish to sort by more than one parameter; you can the Data Sort menu. For example if you want to sort by Gender and sort by Age within the Gender try to follow the example in figure 16-3.

Page 85

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 16-3 Note how in figure 16-3 the ages are sorted within the Gender. You may sort, using this function, by up to three parameters, descending or ascending.

Page 86

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

17

Auto Filter

Filtering is a fast way to find and work with subsets of data in a table/database. A filtered table displays only the rows that meet the conditions you itemize or specify for a column. When you use the Data> Filter> AutoFilter arrows the headers in the filtered range. appear next to the right of

Figure 17-1 When you choose to use one of the filters Excel indicates the filtered columns with blue. Try to filter the column Job for Electrician; and in Gender M. See figure 17-2.

Filter by Job: Electrician

17-2

Page 87

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Filter by Gender: M

Figure 17-3 The result, in figure 17-3, is the table filtered: all the Male Electricians. You can also use Custom filter. For example, filter all the records for Age older than 40.

Custom

All records for Age > 40

Figure 17-4

Page 88

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

18

Data Forms

A data form is a dialog box that gives you a convenient way to enter or display one complete row of information, or record, in a range or list at one time. Click a cell in the range/table and on the Data menu, click Form.

Figure 18-1 Figure 18-2 displays the form.

Figure 18-2 You can do one or more of the following: Add a record: Click New. Type the information for the new record. When you finish, press ENTER to add the record. Change a record: Find the record you want to change. To move through records, use the scroll bar arrows in the dialog box. To move through 10 records at a time, click the scroll bar between the arrows. To move to the next record in the range or list, click Find Next. To move to the previous record in the range or list, click Find Prev. To search a record using conditions:

Page 89

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Click Criteria, then enter the criteria into the form. To find records that match the criteria, click Find Next or Find Prev. To return to the data form without searching for records based on the criteria you specified, click Form. Delete a record: Find the record and press Delete. Note: Data forms can display a maximum of 32 fields at one time.

Page 90

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

19

Grouping and Outlining Data

You can create an outline for your data so that you can show or hide levels of , , and to detail with a single click. You can click the outline symbols display only the rows or columns that present summaries or headings for sections of your data, or you can use the symbols to see details for individual summaries or headings. The data for an outlined should be in a range. Each column should have a label in the first row and you should not have blank rows or columns within that range. When the range has function, such as SUM, You can automatically outline the data. If you wish to outline columns, make sure your range has labels in the first column. Outlines can have up to eight levels. Select the range of cells you want to outline. On the Data menu, point to Group and Outline, and then click Auto Outline.

Example: The workbook Groping shows data we wish to group and outline. Each QTR raw sums the data above it. See figure 19-1. In column I we sum the data horizontally for each of the rows.

Figure 19-1

Page 91

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

To group and outline the data: On the Data menu, point to Group and Outline, and then click Auto Outline. The results are in figure 19-2.

Figure 19-2 You can click the outline symbols , , and to display only the rows or columns that present summaries or headings for sections of your data, or you can use the symbols to see details for individual summaries or headings. If you click on the 2 on the left icon figure 6-11. , it will group the data as you see in

Figure 19-3 To show on of the details we can click on the . Use can use the to hide it.

Page 92

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 19-4 You could hide all the data, using the icon 1 for both directions. Figure19-5.

Figure 19-5 Try different grouping for the columns and the rows. To return to normal view: On the Data menu, point to Group and Outline, and then click Clear Outline.

Page 93

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

20

Subtotals

You can calculate subtotals and grand total values in a table. When you insert automatic subtotals, Excel outlines the table so that you can display and hide the detail rows for each subtotal. The same way we explained above under Grouping and Outlining. To insert subtotals, you have to sort the table so that the rows you want to subtotal are grouped together by a certain parameter. You can calculate subtotals for any column that contains numerical values. The Subtotal calculates subtotal values with one of 11 different functions, such as Sum, Max or Average. You can display subtotals in a list with more than one type of calculation at a time. Grand total values are derived from the data, not from the values in the subtotal rows. If you use the Average summary function, the grand total displays an average of all detail rows in the list, not an average of the values in the subtotal rows. Excel recalculates subtotal and grand total values automatically as you edit the detail data. Create summary reports When you add subtotals to a list, the list is outlined so that you can see its structure. You can create a summary report by clicking the outline symbols , , and to hide the details and show only the totals. Example: Consider the data we use is the Database sheet of figure 20-1. The data was sorted by Gender.

Page 94

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 20-1

Now we can use the Data Subtotal to get the average age of females and males and the average seniority of females and males.

Figure 20-2 Note how, in figure 6-15 the data is grouped and outlined. You can use the outline symbols , , and to display only the rows or columns that present summaries or headings for sections of your data, or you can use the symbols to see details for individual summaries or headings. We clicked on the 2, as you can see in 20-3.

Page 95

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 2-03 You can use same menu to remove the subtotals. Sort by a different parameter and start again. Please note: When data is grouped or filtered some of the rows or columns are hidden. When you attempt to copy the data and paste it somewhere else the complete data set is being pasted. You wanted the visible data only! To overcome this problem you wish to copy the visible cells only. To do so: select the are you want to copy Click ALT+; (which is equivalent to Go To Visible Cells only) Copy and paste!

Page 96

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

21

Pivot Tables

When you have a large database and you want to discover trends and patterns at a glance you can use PivotTable reports to help you. Pivot Table enables you to: summarize the data contained in a large tables into a compact layout find relationships within the data that are hard to see because of vast amount of data organize the data into a format that can be charted easily First you have to decide what questions you want the data to answer. To construct a Pivot Table you need to identify these two elements in your data: Parameters or data fields, that are the variables you want to summarize Column fields that are the variables that will organize the data summary Each one of the headers, on the first row of the data should have a unique header. There should be no empty rows or columns within the range of data used for the report. Each column should contain only one kind of data: text in one column and numeric values in a separate column.

PivotTable Example On the database we used before we would like to see the average age by Gender and Job.

Average age by Job and Gender

Figure 21-1

Page 97

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

We start by going to the Data Manu: PivotTable and PivotChart Report. The four steps are shown in figure 21-2.

Figure 21-2 Using Excel XP or 2003, you Excel sheet will look like figure 21-3. Older versions of Excel will look different but the functionality is the same.

Figure 21-3 You see the Pivot Table tool bar, the items that you can drag into the pivot table report. And the pivot table report layout. The report layout has four areas:

Page 98

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

The Drop Page is on top of the page under A1:G1. This is the area you use to filter the data. The Row Drop is the area where you drag fields you want on the horizontal part of the table. The Column Drop is the area where you drag fields you want on the vertical part of the table. The center, Data Drop area is where you wish you data summarized.

In our example we will drag the Gender to the Row Drop area on the left and the Job field to the Column Drop area resulting in the layout you see in figure 21-4.

Figure 21-4 Now we have to drag the data filed, the Age to the Drop Data area in the center. The default result, of doing so, is the SUM of the ages for each on of the cells.

Figure 21-5 For example, the sum of all the ages of all the Female Carpenters is 67. The sum of the ages of all Machinists is 85. The sum of the Ages of all Males is 370. We wanted the AVERAGE not the sum. TO change the PivotTable Report to read Average we have to modify the report. We double click the Sum and change it to Average. Before we OK it we will format the cell. Follow the steps in figure 21-6.

Page 99

Excel For Analysts and MBAs

Isaac Gottlieb, PhD


2. Change the Sum to Average

1. Double click here

3. Click on Number to format the cells 4. Click on Number on new menu Final Menu

Figure 21-6 The resulting PivotTable report is displayed in Figure 21-7.

Figure 21-7 For example, the average age of Female Carpenters is 33.50. The average of the ages of all Machinists is 28.33. The average age of all Males is 37.00. The average age of all male Machinists is 28.50. We can pivot the table. Drag the Job field to the left, where the Gender is and drag the Gender field to the top where the Job is now. The result is shown in figure 21-8.

Page 100

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 21-8 We can drag the Gender to the top of the page (Drop Page Field Here) and drag the Dep filed where the Gender Field is now. The result is shown in figure 21-9.

Figure 21-10 We can use the TOP PAGE Field to filter it. Figure 21-11 displays the results filtered for Males.

Figure 21-12 Datamining with Pivot Tables In this example we are using a sales report to try and detect pattern using the PivotTable report. In figure 21-13 you see a small section of the data. The data has 1,000 sales records.

Page 101

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 21-13 We will try to detect relationships between the different characteristics of the customers and the purchases. We can start with the number of children, the number of mailings and the purchases. We will drop, the field children of the left In the Drop Row Fields area and the mailings in the Drop Column Fields area. The data, we seek to analyze, will be dropped in the Drop Data area in the center. See figure 21-14

Figure 21-14 As you recall the summary is going to show the SUM of the purchases for the different cross sections. See figure 21-15.

Figure 21-15

Page 102

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

What we really want to do is to find the Average purchases. To do so we have to double click in the Sum of Purchases (upper left side of figure 21-15) and follow the steps in figure 21-16 to get the averages formatted as numbers with zero decimal places..

Figure 21-16 The results are displayed in figure 21-17. This table gives us very interesting information.

Figure 21-17 Notice how for the Grand Total of the average amount spent as a function of the number of mailings sent out, the average amount spent increases as the number of mailing increases (the last row in the table). Of the other hand, if you look at the left column, as the number of children increases the average amount spent decreases. This pattern, of increased spending, it true for the increased number of mailings for each category of children. Look at each one of the rows. The trend of decreased spending, as the number of children increases, is also true for any number of mailings the customers received. Check each one of the columns.

Page 103

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

If you wish to get a better picture of the situation, click on the chart wizard icon on the PivotTable tool bar. See figure 21-18.

Figure 21-18 The chart the was created does not express the situation you will detect if you use the 3-D Column chart. Right click on the chart; click on Chart Type and change to the 3-D Column chart.

Right click and choose Chart Type

Figure 21-19

Figure 21-20 The resulting chart in figure 21-21 speaks for itself. You can visualize the patterns in the data we described above.

Page 104

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Average of Purchases

500 450 400 350 300 250 200 150 100 50 0 0 1 1 2 3 2 3 4 Mailing 1 2 3 4

Children

Figure 21-21 Going back to our PivotTable report, you may want to know the frequencies associated with each one of the results in the table. You have to double-click on the Average of Purchases and change it to count as you see in figure 21-22.

Figure 21-22 The results are show on figure 21-23

Figure 21-23

Page 105

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

On figure 21-23 you observe that the average amount spent by customers with zero (0) children that received four (4) pieces of mail had average purchases of $494. You can tell, looking at figure 21-23, that 124 customers fall into this category. If you want to filter this number you may want to know how many customers own their homes. We are going to add the Home Rent/Own variable to the filtering area on the top of the sheet. See figure 21-24. You can filter it to home owners.

Figure 21-24 Only 74 families own a home, have zero (0) children that received four (4) pieces of mail. You can change the count back to average and discover that the average amount purchased by these customers is up to $585. See figure 21-25.

Figure 21-25

Page 106

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

We have 74 customers with zero (0) children who received four (4) pieces of mail. We could filter it down further. For example we wish to select only old customers (who have purchased from us in the past. We move that field next to the Home Rent/Own on the top. Figure 21-26.

Figure 21-26 When we choose: Old for Customer Type-- the average increase to $780.

Figure 21-27 In order to figure out how many Old customers, Own a Home, Have zero (0) children, and Received four (4) pieces of mail, we have to change the PivotTable to read the Counts again. Figure 21-28.

Page 107

Excel For Analysts and MBAs

Isaac Gottlieb, PhD

Figure 21-28 If you wish to identify the 25 Old customers, who Own a Home, Have zero (0) children, and Received four (4) pieces of mail (see circle on figure 641): DOUBLE CLICK THAT CELL. The customers will be listed on a new sheet. See figure 21-29.

Figure 21-29

Page 108

Você também pode gostar