Transcript
  • 10/13/13 Spreadsheet Modeling

    1/52

    This document is authorized for use only by Srinivasarao Maddala. Copy or posting is aninfringement of copyright.

    Spreadsheet Modeling

    Pretest Introduction

    Welcome to the pre-assessment test for the Spreadsheet Modeling tutorial. This test will allow y ou to assessy our knowledge of some basic modeling skills.

    To adv ance from one question to the next, select one of the answer choices and click the Submit button.After submitting y our answer, y ou will not be able to change it or return to the question, so make sure y ouare satisfied with y our selection before y ou submit each answer.

    Some problems ask y ou for a formula. It is probably easiest to determine the correct formula in Excel andthen paste it into the Pretest answer area. This will av oid sy ntax errors. For example, if in Excel y ou ty pe inthe formula =SUMIF(B1 :B1 0,C8,D1 :D1 0) and think that is the correct answer, just selectSUMIF(B1 :B1 0,C8,D1 :D1 0) in Excel and copy it. Then paste it into the input answer area within thequestion.

    Your results will be display ed immediately upon completion of the test. The results screen will display eachquestion with a graphic notation indicating y our score: X for incorrect and check mark for correct.

    Click Pretest in the menu bar to the left to begin. You can also return to y our test results at any time (aftercompleting the exam) by clicking Pretest Introduction and then Pretest.

    Good Luck!

    Introduction

    Most work done by business analy sts can be categorized as either reporting (prov iding required data) oranaly sis (building models to help y our organization make the right decisions). In today 's world, mostbusiness reporting and modeling is done using Microsoft Excel. Completing this online course shouldincrease y our ability to use Excel to create reports and/or dev elop powerful business models. Ev en if y ouhav e nev er used Excel before, we will teach y ou how to use Excel's powerful functions and chart capabilitiesto solv e a my riad of business problems.

    If y ou are a student, then during y our undergraduate or MBA program y ou will hav e to build many modelsto analy ze cases or build spreadsheet models in courses such as finance, marketing, accounting, operationsand management science. We will giv e y ou the spreadsheet knowledge needed to tackle the manyanaly tical questions that arise during y our course work.

    If y ou are a business analy st, this course will introduce y ou to many new concepts and tools that will helpy ou more quickly and accurately summarize business data. The course will also teach y ou how to dev elopspreadsheet models that will help y our organization make better decisions.

    The Company

    Le Napoleon is a bakery specializing in French pastries, now owned by a partnership that includes itstwo ex-pat French pastry chefs, Michel Toure, whose family mov ed to Strasbourg from Mali when he wasa small child, and Anne-Sophie Le Nguy en, who grew up in the Cognac region.

    The two met each other not long after mov ing to the U.S. and found that not only did they hav e a shareddream of business ownership but that each had strengths to offset the other's weaknesses. Both hav eexceedingly refined tastes, but their success lies more in Michel's way with obscure ingredients andtechniques and Anne-Sophie's ambition and exceptional understanding of the customer.

    Le Napoleon got its start in a business incubator, and at first, the bakery had just a small stand at theweekly farmer's market. Soon, though, satisfied customers began to place special orders. When Micheland Anne-Sophia had to turn down their third wedding cake request, they decided to sit down and workout a plan to mov e out of the business incubator and into their own, dedicated location. The business isnow thriv ing.

  • 10/13/13 Spreadsheet Modeling

    2/52

    In this course, we will use operations at Le Napoleon to illustrate some of the problems that businessesboth large and small must faceand Excel to illustrate solutions to those problems.

    Spreadsheet Modeling Overview

    In the first three sections of this course we begin by familiarizing y ou with the Excel env ironment andshowing y ou how to mov e around in a spreadsheet. If y ou hav e used Excel extensiv ely y ou may choose toskip these chapters. In the Excel Formulas and Functions sections, we thoroughly explain how to enterand copy formulas in Excel. We also will teach y ou about Excel's many powerful functions including littleknown functions such as MATCH and INDEX. Just like the key to a great recipe is the proper use of thatspecial spice or ingredient, the key to building a spreadsheet that solv es a business problem is oftenmastery of Excel's many powerful functions.

    In the section on Excel Functions we cov er Excel's many tools that can be used to create great looking andinformativ e reports (conditional formatting, piv ot tables, subtotals, SUMIFS and COUNTIFS functions,etc.). In the Charts section, we show y ou how to use Excel to create informativ e charts. In the nextsection, y ou will learn how to import word files and Internet data into the Excel env ironment.

    The Art of Spreadsheet Modeling section contains an extensiv e explanation of how to build spreadsheetmodels to solv e a business problem. For example, should a bakery open a new outlet? How should we planto sav e for retirement? In this section, we cov er many exciting modeling tools such as Auditing, spinnercontrols, Goal Seek, Data Validation and Data Tables. The Using Excel Solv er section cov ers the ExcelSolv er tool which is used to find the optimal solution to a problem. The Three-Dimensional Formulassection explains how 3D formulas and Excel's Table feature can make y ou much more efficient when y oudev elop spreadsheet models. Finally , the Monte Carlo Simulation closes the course by introducing y ou toa really efficient model building tool. In that section, y ou will learn how Monte Carlo simulation can beused to model the effect of uncertainty on business decisions.

    The spreadsheet is the canv as for the business analy st. This course giv es y ou the "artistic skills" needed todev elop state of the art spreadsheet models for solv ing business problems.

    The Excel Environment

    Ev en simple workbook tasks will become tedious and prone to errors if y ou do not know how to use Excelefficiently . In this chapter we will introduce the following aspects of the Excel env ironment and basicefficiency measures.

    Opening workbooksThe Excel 2007 Ribbon and the Quick Access ToolbarWorking with worksheetsWorkbook- and worksheet-lev el nav igationPrinting worksheets and workbooksSav ing workbooks as Excel and other file ty pes

    Throughout this course, we will continue to present way s to increase not only y our proficiency in but alsoy our efficiency with Excel.

    Opening a workbook

    To open a workbook, use any of the following techniques.

    Double-click its icon in Windows Explorer. This will work as long as Windows knows that the filecan be opened in Excel.If Excel is running, hit Ctrl-O or the Office Button (the round button in the upper-left-hand cornerof the Excel window) and browse for the file. You can use the "Files of ty pe" drop-down box to v iew anumber of different file ty pes.

    If Excel is running and the icon representing y our file is the generic Windows icon (examplebelow), but y ou know that Excel can read it, it might be easiest to drag the icon into the Excelwindow. You can use this method for any file ty pe that Excel can open.

    Open the Excel Env ironment.xlsx file by any of the abov e methods. This file contains data from

  • 10/13/13 Spreadsheet Modeling

    3/52

    questionnaires completed by customers of Le Napoleon. Leav e this file open, as we will continue to work with it.

    Open the Excel Env ironment_non_Excel.asp file by dragging its icon into the already running Excel window. Note: If y our installation of Excel is not able to read this file, don't worry we will not be using this file for any thing else.

    Close the Excel Env ironment_non_Excel.asp file by clicking the X for the workbook. This is the button that reads "Close Window" when the pointer hov ers ov er it.

    The Excel 2007 Ribbon

    The Ribbon in each of the Office programs organizes commonly used commands and features intocategories. Each category is represented by a tab, and each tab contains groups of subcategories.

    For example, in Excel, the Rev iew tab contains three groupsProofing, Comments, and Changes. Eachcontains features commonly needed when rev iewing others' workbooks, or before sending y our ownworkbooks out for rev iew or use by others.

    Take some time to explore the different tabs.

    The Quick Access Toolbar

    The Quick Access Toolbar is a customizable docking place for features and commands that y ou use mostfrequently . It is found just to the right of the Office Button and by default display s buttons for Sav e, Undo,and Redo. No matter which of the Ribbon's tabs is selected, the Quick Access Toolbar is alway s v isible.

    Explore the customization options for the Quick Access Toolbar. In doing so, look at not only PopularCommands but also All Commands. Once y ou configure the Quick Access Toolbar to suit y our needs, y ouare only a click away from the features that y ou use the most.

    Worksheets

    Each workbook file contains one or more tabbed worksheets. You can easily set the number of worksheetsthat y ou want new workbooks to contain, rename sheets, and mov e and delete worksheets.

    Note that spaces, dashes, and certain other special characters are legal in sheet names, while othercharacters, such as \ / ? are not. Also, although we hav e opted to use spaces in the sheet names in ourexample file, know that this can complicate more adv anced uses of the program.

    In the Excel Env ironment.xlsx file, rename the bakery1 worksheet to bakery mon-thurs, bakery2 to bakeryfri-sun; mall1 to mall mon-thurs and mall2 to mall fri-sun.

    Mov e sheets to be in this order: bakery mon-thurs, bakery fri-sun, mall mon-thurs, mall fri-sun.Rename Sheet1 to key. Mov e this sheet to the beginning of the workbook.

    You can also mov e or copy worksheets into another workbook. This is handy if y ou are working on a teamand need to bring people's indiv idual work into a single file.

    Insert a new sheet and call it summary. Mov e it to the beginning of the workbook, before the keyworksheet. We will leav e this sheet blank for now.

    Moving Around a Worksheet and Workbook

    Learning a few hotkey s, howev er, will allow y ou to keep y our hands on the key board, which many peoplefind improv es efficiency . Some nav igation hotkey s are

    Ctrl-Home: Selects cell A1Ctrl-End: Selects the cell at the intersection of the last-used column and last-used row on theworksheetPage Up: Scrolls up one screenPage Down: Scrolls down one screenAlt-Page Up: Scrolls left one screen

  • 10/13/13 Spreadsheet Modeling

    4/52

    Alt-Page Down: Scrolls right one screenCtrl-Page Up: Selects the prev ious worksheetCtrl-Page Down: Selects the next worksheetCtrl-Tab: Mov es to the next open Excel workbook

    Pressing the Alt key once will allow y ou to quickly select a ribbon using its letter key , and then selectitems on that ribbon using each item's letter key . The screenshot below shows the ribbon when the Altkey is pressed. Pressing the M key would open the Formulas ribbon, and items on that ribbon would thenbe identified by their key s.

    In the Excel Env ironment.xlsx file, starting with the bakery mon-thurs worksheet

    Use Ctrl-Home to mov e to cell A1 and Ctrl-End to mov e to the last cell in the data range (observ e thatthis may be a blank cell).

    Use Ctrl-Home again to return to cell A1 .Use Page Down to scan through the data one screen at a time.Use Alt-Page Down and Alt-Page Up to scroll left and right.Finally , use Ctrl-Page Down to mov e to the next worksheet.

    Continue to practice these nav igation hotkey s in the Excel Env ironment.xlsx file. You might find ituseful to keep a list of these hotkey s near y our computer until using them becomes second nature.

    Printing a Worksheet

    In a later chapter, we will discuss print areas and page setup.

    View the key worksheet in Print Prev iew. Note that before printing this worksheet, we will probably wantto make some adjustments. Don't click Print; instead click the Close Print Prev iew button on the PrintPrev iew tab.

    Saving a Workbook File

    To sav e a workbook, hit Ctrl-S, or click the Sav e icon on the Quick Access Toolbar.

    Sav e Excel Env ironment.xlsx as an .xls file.Sav e the bakery mon-thurs worksheet as a .csv (comma-separated v alues) file named bakery1.csv.

    Sav ing Exercise Solution

    Working with Data: Basic Techniques

    Our main goal in this chapter is to introduce efficient methods for working with cells and ranges. In thischapter, we will use the file Working with Data.xlsx, so please download this workbook now. Please followalong as we outline changes to the workbook.

    Cells and Ranges

    Each rectangular block in which data can be entered is a cell. Each cell has an address. In mostconfigurations of the program, this is the letter of the column and the number of the row that intersect atthat cell.

    Excel 2007 spreadsheets hav e 1 ,048,57 6 rows and 1 6,384 columns or ov er 1 7 million cells. Bycomparison, Excel 2003 spreadsheets hav e 65,536 rows and 256 columns.

    A block of cells that is to be treated as a unit in some operation (e.g., formatting, summation) is called arange. Ranges are known by the addresses of their upper-left-most cell and lower-right-most cell. A colonserv es to separate the two addresses. In the screenshot below, the range B2:C5 is selected.

    Selecting Ranges

    There are a number of way s to select ranges of cells. In this section, we will explore the selection ofcontiguous cells using the selection pointer as well as the Ctrl and Shift key s. We will also discuss a means

  • 10/13/13 Spreadsheet Modeling

    5/52

    of easily selecting ranges within a large dataset.

    Selection Pointer

    On the bakery mon-thurs worksheet, select the range F2:F1 1 . Check the status bar for statistics on thisrange.

    While we are on the topic of statistical functions, it is worth pointing out that zero v alues are includedin av erages and other statistics, whereas blank cells are not.

    Change y our status bar settings so that the fiv e statistics mentioned abov e av erage, count, min,max, and sum are display ed in the status bar when data is selected.

    Ctrl and Shift

    Holding down the Ctrl key tells Excel that y ou want to jump to the end of the range. Holding down theShift key tells Excel to select all of the intermediate cells along the way .

    Practice with Ctrl, Shift, and Ctrl-Shift. On the key worksheet, select cell A2. Hold down just theCtrl key and hit the right arrow key . The selected cell should now be R2, the last cell in thecontiguous range A2:R2.

    Select cell A2 again. This time, hold down just the Shift key and hit the right arrow key .Keepingthe Shift key held down, hit the right arrow key a few more times. You should see that Exceladv ances one cell at a time, adding cells to the selection.Select cell A2 a final time. Hold down both Ctrl and Shift, and hit the right arrow key . Excelboth "mov es" all the way to R2 (Ctrl key behav ior) and retains the selection of the intermediatecells (Shift key behav ior).

    In cases where there are blanks in the data, it is helpful to work with a split screen, as shown in the nexttopic.

    Splitting the Screen

    The Split button on the View tab, in the Window group, can also be used to quickly split the screen bothhorizontally and v ertically .

    Check to see that y our installation of Excel is configured to show in the status bar at least theminimum, maximum, and av erage of a selected range of data. Split the screen of the bakery fri-sun,mall mon-thurs, and mall fri-sun worksheets. Then, by selecting data on each of the four questionnaireresults worksheets, quickly compare basic statistics for the results of question (1 0) in column K,Satisfaction with v ariety of goods, on a scale of 1 to 5.

    There are, of course, functions and other way s of obtaining such statistics. But since selecting cells isextremely fast, it can serv e as a good quick auditing tool, to double-check the results of functions.

    Alternativ ely , if the screen is split, click the Split button on the View tab to un-split it.

    Selecting All Cells in a Dataset Using Shortcut Keys

    On the bakery mon-thurs worksheet, select any non-blank cell and use one of the two techniques describedto select the entire dataset. Then select a blank cell within the dataset and try this again. Either way , thewhole dataset should be selected.

    Selecting All Cells on a Worksheet

    The Select All button allows y ou to quickly select all cells on a worksheet.

    Selecting Noncontiguous Ranges

    Sometimes we want to select noncontiguous ranges, for example, to format a number of isolated cells atonce, or to include them in a function. In this section, we will explore two way s to select such ranges.

  • 10/13/13 Spreadsheet Modeling

    6/52

    Using the Ctrl Key

    On the bakery mon-thurs worksheet, select both B2:B8 and M2:M8.

    Using F8 (Extend Selection) and Shift-F8 (Add to Selection)

    You might like this technique.

    The function key F8 and Shift-F8 can also be used to select ranges, including noncontiguous ranges.When y ou hit F8 the first time, Excel enters "Extend Selection" mode and behav es as if y ou had theShift key held down.

    Once y ou hav e the selection that y ou want, hit F8 a second time to exit Extend Selection mode. Yourselection will remain activ e unless y ou select another cell. If y ou want to select a second range, usethe trick described next, Shift-F8.

    Hitting Shift+F8 puts Excel in Add to Selection mode. In other words, y ou can

    Use F8 to select a range (remembering to hit F8 to exit Extend Selection mode when y ou areready ).Use Shift+F8 to select a second range (which can also then be done with the F8/Extend Selectiontechnique).

    Selecting Cells and Named Ranges

    In this section, we will explore two way s of quickly selecting cells. These allow us to select a cell based onits address (e.g., C24) or a cell or range of cells based on an assigned name (e.g., rev enue; surv ey _data).

    In Name Box

    The Name Box, found just abov e the header for column A, shows the name of the currently selected cellor range (more on named ranges in a later chapter). In the screenshot below, the Name Box reads A1 .

    By ty ping a cell address or range name in the Name Box and hitting Enter, y ou can select (and jumpto) cells or named ranges.

    On the bakery mon-thurs worksheet, ty pe L97 , and hit Enter. Excel should take y ou to that cell. Nowreturn to the Name Box and click its drop-down arrow. You should see questions as an option; this isbecause we hav e assigned the name questions to a range. Choose questions from the drop-down list tojump to this range.

    With the F5 Key (Go To Dialog Box)

    The function key F5 brings up the Go To dialog box, which can be used to select cells and jump to namedranges. Simply hit F5 and choose the desired range name from the list display ed in the Go to: box, orenter the desired cell address in the Reference: box.

    On the bakery mon-thurs worksheet, use the F5 key to go to cell G99. Then use it to go to the rangenamed questions.

    Note that the Go To dialog box keeps a running list of cells v isited in the current Excel session.

    Selecting Otherwise Difficult to Select Cells with Go To Special

    The Go To dialog box can also be used to select cells that would otherwise be fairly difficult tocomprehensiv ely identify and select. Clicking the Special button at the bottom-left corner of the Go Todialog box brings up a list of ty pes of cells that users commonly need to select, such as blank cells, cellscontaining errors, cells containing comments, and many others.

    Assume management at Le Napoleon wanted to add shading to the blank cells in the bakery mon-thursdataset, to see more easily whether just a few or many items on their questionnaire are being left blank.(Incidentally , there is a function to return the number of blank cells in a range: the COUNTBLANKfunction.) It would be v ery time-consuming to select each blank cell by hand. This would also be prone to

  • 10/13/13 Spreadsheet Modeling

    7/52

    error some blank cells would likely be left out, and some cells containing v alues would likely be selected

    by mistake. The Special options in the Go To dialog box can take most of the work out of this task.

    On the bakery mon-thurs worksheet, select any cell in the block of data. Hit the F5 key and click theSpecial button. Choose Blanks, and hit OK. All blank cells within the block of data should now be selected.Do not click any cells, or y ou will lose the selection! Now choose a fill color from the palette on the Hometab (in the Font group, under the selector for font size), and all blank cells will be shaded. (Conditionalformatting, to be introduced in a future chapter), would be another way of shading these blank cells.)

    Filling Series

    For commonly used series and entries that Excel can populate to be part of a series (e.g., Bakery Item 1 ,Bakery Item 2), y ou can use the Autofill handle to fill in as much of the series as y ou need. The Autofillhandle appears at the bottom right of a selected cell or range of cells; it appears to be a small squaresuperimposed on that corner of the black border around the selected cell.

    When the pointer hov ers ov er the Autofill handle, it changes shape to resemble a cross.

    Like dates, times can be autofilled, with Excel augmenting the v alue in each cell by one hour. Unlikewith dates, howev er, the Auto Fill Options will not allow y ou to change the increment to fifteen minutesor a half-hour.

    This same technique, specify ing the first two elements of the series before autofilling, could be used if y ouwanted to create a series like {1 , 2 , 3 . . .} or {5, 1 0, 1 5 . . .}.

    Another way to create a series like {1 , 2 , 3 . . .} is to use the Fill Series command. This is especially usefulif y ou often find y ourself ov ershooting the mark when y ou drag with the mouse.

    In addition, y ou can define y our own custom fill series. For example, Le Napoleon might want to define aseries based on a list of specialty pastries, hourly employ ees' names, or names of restaurants that procuredessert offerings from the bakery . Once the series is defined, only one element from the series would needto be entered manually ; the rest could be autofilled.

    On the bakery mon-thurs worksheet, edit Question_1 to read Question 1 . Fill to complete the seriesthrough Question 1 6.

    Select the bakery fri-sun worksheet. In column A, below the Respondent label, create v alues from 1 to1 00 v ia autofill.

    Do the same for the mall mon-thurs worksheet (again using numbers from 1 to 1 00), but this time,double-click rather than dragging the autofill handle. Because there is a block of contiguous datain the adjacent column, Excel fills the series to the end of that block.

    For the mall fri-sun worksheet, use Fill Series to create numbers from 1 to 1 00.

    Download the file Working with Data_products.xlsx. Using the data on Sheet1 , create a custom fillseries. Test y our series to see that it works. Then, if y ou wish, feel free to delete the series (v ia ExcelOptions).

    Copying and Moving Cell Entries

    To copy and paste data, select the range to be copied and use Ctrl-C, the Copy button on the Home tab, orthe right-click context menu to copy the data.

    Then select the upper-right-most cell in y our desired destination range, and use Ctrl-V, the Paste buttonon the Home tab, or the right-click context menu to paste the data.

    To mov e data, y ou can Cut rather than Copy , and then Paste.

    Alternativ ely , y ou can use the mov e pointer:

    The Undo Command

  • 10/13/13 Spreadsheet Modeling

    8/52

    Many operations can be undone using either Ctrl-Z or the Undo button on the Quick Access Toolbar:

    Or, if y ou need to undo multiple operations, the drop-down list next to the Undo button:

    Excel 2007 allows undo operations ev en after a sav e, but not once the file has been closed.

    Be aware that the undo stack is shared by all open workbooks; i.e., y ou cannot undo only a change toBook1 if after that change y ou made a change to Book2. You could, howev er, undo the change to Book2and then the change to Book1 .

    Increasing Spreadsheet Readability

    It is often the case that the person who designs a spreadsheet application is not the end user, or the onlyuser, of the file. Designing for usability by others is important. Among other considerations, y ou mightwant to minimize the amount of time it takes others to understand how y ou hav e organized a workbook, orlimit the way s in which they can introduce errors into a workbook. You might want to control the kind ofdata that can be entered in cells, prev ent users from deleting formulas, or ev en keep the workbook windowfrom being resized.

    In this chapter, we will look at a few simple things y ou can do to make y our worksheets more user-friendlyin terms of simple readability . We will continue to work with the data from Le Napoleon's questionnaire.

    We will use the file Increasing Spreadsheet Readability .xlsx, so please download this workbook now. Pleasefollow along as we outline changes to the workbook.

    Working with Rows and Columns

    The summary worksheet needs a better indication that the figures on that sheet are av erages of thequestionnaire data for which an av erage is a meaningful measure. We will want to insert some rows tohold that information and set it off from the table of av erages.

    The Insert button and Delete button on the Home tab, in the Cells group, can also be used to insert anddelete rows.

    On the summary worksheet, insert one row abov e row 1 . Enter the text "Av erage for questions (5)-(1 1 )"in cell A1 .

    On the summary worksheet, increase the height of row 2. Select columns A through H and double-click toauto-adjust them to their contents. The result is clearly undesirable. Click the Undo button. Later in thischapter, we will wrap the text in rows 2 and 4 before adjusting the column widths.

    Assume an employ ee at Le Napoleon is analy zing the questionnaire data on the bakery mon-thursworksheet and wants to get an opinion from someone outside the company . Clearly Le Napoleon wouldwant to keep customers' names and addresses priv ate. Assuming that the interaction is to take place inperson (i.e., the employ ee is not sending the workbook file outside the company ), one quick solution wouldbe to temporarily hide those columns.

    Rows can be hidden in the same manner.

    We would like to note that while hiding columns (or formatting cells with, e.g., white font on white fill,for that matter) can keep data out of v iew, it is not a way of formally protecting sensitiv e data.

    Making Better Use of Screen Space

    Column headers are often longer than the area needed to display the data under them. We saw this onthe summary worksheet when we auto-adjusted columns A:H; they became far wider than necessary todisplay the data. If management wants to be able to v iew not only the av erages on the summary sheet butalso the clarify ing text, the cells containing that text will need to be formatted to make better use ofscreen space. We will use text wrapping and other formatting techniques to accomplish this.

    Text can also be rotated for a better fit or appearance. We will rotate the headers for the questions on thesummary worksheet.

    Cell C3, which helps to clarify questions (6)-(1 1 ), is long enough that it causes its column to be

  • 10/13/13 Spreadsheet Modeling

    9/52

    considerably wider than the others. This could be remedied by merging cells C3:H3. Merging cells caninterfere with the ability to copy formulas and complete certain other operations. Instead, we will centerthe text in cell C3 across the range C3:H3. Unlike a merge and center operation, this will allow Excel tocontinue to treat cells D3:H3 as indiv idual cells.

    Basic Cell Formatting

    The font face, font size, font color, and fill color can be set in a number of way s. One is through thebuttons in the Font group on the Home tab, in the Format Cells dialog box, another is v ia the menu. Wewill change sev eral formats in order to make the summary worksheet easier to read.

    Borders and patterns can also be set in the Format Cells dialog box. We will apply borders and patterns tothe range on the summary worksheet that contains the av erages.

    Note that borders (but not patterns) can also be applied using the buttons on the Home tab, or the menuthat appears when y ou right-click a selection.

    Basic Number Formats

    We will continue to improv e the look and readability of the summary worksheet by making use of someof the many different way s of display ing numeric v alues in Excel. Specifically , we want to display theresults of question (5), "To the nearest dollar, how much was y our order?," as dollar v alues, and to displaythe remaining numeric v alues on the worksheet with fewer decimal places than are currently display ed.

    Also use the Decrease Decimal button to decrease the number of decimals display ed for the av erages forquestions (6)-(1 1 ) to two. Do not format these as currency , howev er.

    In the Format Cells dialog box, there are other pre-programmed way s of display ing currency v alues andother ty pes of numbers.

    Note that Excel does not actually perform currency conv ersion when y ou change a v alue from beingdisplay ed as U.S. dollars to being display ed as Euros. If y ou wanted to perform currency conv ersions on aworksheet, use the pre-programmed Currency Rates data connection file to insert current exchange ratesinto y our workbook and update them at specified interv als. You can access this feature from the Data tab,v ia the Existing Connections button in the Get External Data group.

    There are many other way s of display ing v alues (including date and time v alues, these being stored asnumbers). The table below presents just a few possibilities for formatting the v alues 1 234567 89 and.1 234567 89.

    Keep in mind that formats are cosmetic changes only (i.e., the dashes in the social security format shownabov e are characters added by Excel when the number is "printed" to the screen they do not reside inthe cell itself).

    Rather than using a cy clical calendar, Excel stores dates as v alues on a number line. While we might seethe date June 7 , 1 999, as hav ing something in common with June 7 , 2008, Excel knows the first of theseas the v alue 3631 8 and the second as 39606.

    To the right are some dates and their equiv alent numeric v alues in Excel. We can see from the first fiv eexamples that 1 /1 /1 900 is the beginning of the Excel epoch, and that each date is 1 greater than the daybefore. As Excel understands it, Prince was born on 21 343!

    What this means is that v alues meant to be numeric in nature can be display ed as dates, and v aluesmeant to be dates can be display ed as numbers. Expecting to see a cell display , for example, the number1 3 as the output of some operation, and instead seeing 1 /1 3/1 900, can cause a good deal of confusion tothe beginning Excel user. By the same token, Excel will also be happy to format Prince's birthday ,6/7 /1 958, as Currency , display ing $21 ,343.00 as a result.

    There are many way s to display dates in Excel; on the right are some examples using the pre-programmed options in the Date category . Despite the differing lev els of specificity display ed by theformats used, the cells shown here contain identical v alues.

    As efficiently as y ou can, select the dates in column B of the bakery mon-thurs worksheet. Format these asnumber with two decimal places, then currency , then percent. Note that the underly ing v alue in eachcell does not change as y ou mov e from format to format. Then apply the date format of y our choice.

  • 10/13/13 Spreadsheet Modeling

    10/52

    Le Napoleon's bakers are accustomed to looking at dates in European format, in which the day precedesthe month. Ev ery once in a while, the pastry kitchen ends up preparing a special order for the wrong daya costly error!

    Within the formatting options for dates, the Locale setting allows us to display dates in a number of pre-programmed international formats. The screenshot below shows a subset of these.

    When recording special orders, at least, the staff at Le Napoleon might want to change the locale toFrench (France). This would allow the staff to enter dates in mm/dd/y y y y format but hav e them displayon the worksheet in dd/mm/y y y y format.

    Note: If we wanted to affect the way dates are entered, not just display ed, we would need to configure theRegional Settings in Windows.

    Finally , we can create custom date formats by choosing the Custom category and entering the dateformat desired. We'll format the date 8/1 /2008 so that it reads correctly .

    Many other possibilities exist for custom formatting; this is a good option to keep in the back of y our mind!

    Conditional Formatting

    There are many instances in which we might want only certain cells to display a special format. LeNapoleon, for example, might want to highlight av erages on the summary worksheet that managementconsiders subpar. While we could identify and format those av erages manually , conditional formatting iseasier. It is also more powerfulsince it is dy namic, we will not hav e to redo the format if we obtain newdata that driv es some av erages up and out of the range that we wanted highlighted.

    On the summary worksheet, we will format the av erages for questions (6)-(1 1 ) if the v alue in the cell isbelow 3 .

    Now we can easily see that parking might be a good problem to address at the bakery location, whereas atthe mall location (where Le Napoleon sells goods sent ov er from the bakery ), the v ariety of baked goodsappears to be an issue.

    Also on the summary worksheet, we could use data bars to make it easier to compare at a glance the fourav erages for question (5) "To the nearest dollar, how much was y our order?"

    We'll explore a few more examples of conditional formatting in the Increasing SpreadsheetReadability _orders.xlsx workbook. This workbook contains brief details for a number of special ordersthat the clerks at Le Napoleon hav e taken; we could use this to gauge the general size of an order, whetherit might inv olv e ingredients or components not usually part of the pastry kitchen, and when it needs tobe deliv ered or av ailable for pick-up. We can assume that adequate details for the creation of each orderare stored where the chefs can access them as needed.

    First, let's format the dates for orders needed this month with a red sty le, and the dates for those needednext month with a y ellow sty le.

    As usual, select all of the cells that the formatting should apply to (cells B2:B35 on the orders worksheetin the Increasing Spreadsheet Readability _orders workbook). Then, from the Conditional Formattingmenu, select Highlight Cells Rules, then A Date Occurring...

    In the menu box that appears, choose This Month, and Light Red Fill with Dark Red Text.

    Repeat this process, choosing Next Month and Yellow Fill with Dark Yellow Text.

    Management might want to see at a glance which order totals are abov e the av erage. Conditionalformatting has a number of preprogrammed options that compare v alues in indiv idual cells to the entirerange of cells chosen for formatting.

    To format all of the order totals that are abov e av erage, first select cells E2:E35. From the ConditionalFormatting menu, select Abov e Av erage (note the other options in this list before doing so!).

    In the menu box that appears, choose a predefined sty le, or define y our own custom sty le. We hav e chosenGreen Fill with Dark Green Text:

    The time of day that an order is needed can determine whether kitchen staff needs to prepare part of theorder the prev ious day , or come in extra-early that day , or perhaps stay late that ev ening. We would like

  • 10/13/13 Spreadsheet Modeling

    11/52

    to be able to see at a glance what time an order is due, without risking the kind of mistake that can occurby misreading AM for PM or v ice v ersa.

    The preprogrammed color scales in the conditional formatting option prov ide an easy solution. Selectcells C2:C35. Then, from the Conditional Formatting menu, choose Color Scales, and select a color scale.(The Blue - Yellow - Red and the Red - Yellow options both prov ide reasonably intuitiv e formatting for theproblem at hand.)

    To the right is what the data should look like if y ou chose the Blue Yellow Red option.

    Finally , let's rev isit the formatting that we applied to the order totals. In addition to hav ing all abov e-av erage order totals shaded (which we hav e already done), let's say the kitchen wanted to see at a glancehow critical each order is in terms of rev enue.

    A color scale like the one that we applied in the prev ious example would prov ide one quick solution, but itwould compete v isually with the shading already present on abov e-av erage v alues in this range. An iconset is a better way of keeping the existing shading and marking a new distinction.

    Select cells E2:E35 and, from the Conditional Formatting menu, choose Icon Sets. The Red to Black sty lefits nicely with what we are try ing to accomplish heredistinguish these data v alues in another waywithout making the result too v isually confusing.

    The order total data should now look like what y ou see on the right here.

    Increasing Readability Solution

    Color scales, icons, and data bars hav e default settings that determine what v alues will be giv en whatformats. You can change these settings, perhaps choosing a different threshold between a red and a lightred icon, or associating the short end of a data bar with a static v alue rather than whatev er happens to bethe lowest number in the range of cells (handy if y our dataset contains negativ e v alues).

    These settings are configured in the New Formatting Rule or Edit Formatting Rule dialog boxes, whichy ou can access as y ou are first apply ing a format, or after the fact, v ia the Conditional Formatting menu.

    If y ou are setting up a new rule that y ou want to configure more closely , choose the More Rules option(after selecting the general rule ty pe; e.g., Icon Sets).

    If y ou want to go back and configure an existing rule, select the relev ant range of cells, and from theConditional Formatting menu, choose Manage Rules.

    In the dialog box that appears, select the rule to be customized and click Edit Rule. This will open the EditFormatting Rule dialog box, where y ou can make adjustments to the behav ior of the rule.

    Conditional formatting prov ides for much more powerful options than those that we hav e just seen. We'llrev isit the topic of conditional formatting in a later chapter.

    Formatting and Other Options with Paste Special

    Sometimes we format a cell or range of cells with the font colors, borders, patterns, and number formatswe want, only to find that there are other cells that need to be formatted in a similar manner. TheFormat Painter, found on the Home tab, will allow us to copy all of the formats from a cell and then paintother cells with these formats. What if we want to transfer just some formats from one cell to another,howev er?

    Excel has special options that y ou can choose from when completing a copy -paste operation. The PasteSpecial dialog box (accessible v ia the Paste drop-down list on the Home tab) is shown below.

    Setting Up a Worksheet for Printing

    Now that the summary worksheet contains the formatting we want, we can set it up to display the waywe want on the printed page.

    On the Page Lay out tab, Page Setup contains options for selecting the paper size, orienting data, changingmargins, and so on.

    Now click the Office Button, and from the list of Print options, select Print Prev iew. By default, Excel will

  • 10/13/13 Spreadsheet Modeling

    12/52

    send the entire contents of a worksheet to the printer. Since cells J1 4 and J1 5 contain the name andphone number of the group that designed Le Napoleon's questionnaire, Excel will want to print those cells.Howev er, to do this and still use only one pageas we requested when we configured the Page Setupoptionswill require shrinking ev ery thing to the point that our av erages might become difficult to read.

    Instead, let's hav e Excel print only those cells we want by marking a range on the worksheet for printing.

    Among other things, the Sheet tab in the Page Setup dialog also allows y ou to control whether aworksheet's gridlines will print, to repeat the contents of a row or column on each sheet (useful forprinting headers like our respondent's index numbers, or our question numbers on ev ery page of amulti-page print job), and to print Excel's column headings (A, B, C, etc.) or row labels on each page of amulti-page print job.

    Excel Formulas

    People use spreadsheets to compute quantities of interest. In any cell of a spreadsheet we are free to enter aformula to compute a quantity of interest. For example, the management of Le Napoleon might want tocompute the following quantities:

    Each employ ee's weekly pay check and the total weekly pay rollThe cost of producing v arious ty pes of cakesThe cost of purchasing sugar, butter, and flour from each supplier as well as the total amount weowe each supplierThe annual profit from the sale of Sacher Tortes, using v arious price and unit cost scenarios.

    In this unit we will use Excel formulas to efficiently and easily compute these quantities of interest, We willsee that in order to efficiently use formulas we must hav e an understanding of the spreadsheet Copycommand. Our work in this unit will use the file Excel Formulas.xlsx, so please download this workbooknow.

    Copying Formulas

    In worksheet Wages of the file Excel Formulas.xlsx we compute the weekly wage for our 8 employ ees(their names are in cells B4:B1 1 ). For each employ ee we are giv en (in cells C4:C1 1 ) the hours eachemploy ee worked this week, and in cells D4:D1 1 we are giv en each employ ee's hourly wage.

    Now we could compute Will Wong's salary in E5 with the formula =C5*D5 and continue onward andenter a formula to compute each employ ee's salary . Of course, if we hav e hundreds or thousands ofemploy ees, this would be really tedious. Fortunately , Excel's ability to let us "copy " formulas eliminatesthis problem. What we really want to do in each of cells E4:E1 1 is to multiply the two numbers to the leftof column E in the same row.

    To accomplish this goal we simply "copy " our formula in E4 to the cell range E5:E1 1 . Then in cells E5:E1 1our copied formula will try to do in cells E5:E1 1 exactly what it did in cell E4 (multiply the numbers inthe same row in columns C and D). Basically , when y ou copy a formula that has no $ signs attached tocell addresses (more on $ signs later, but do not worry about them now!), then if y ou copy a formula downa row the row numbering the formula is increased by 1 , and if y ou copy a formula across and to the rightone row the column number is increased by 1 .

    The Autocomplete Formula Option

    Try to use the Autocomplete feature to compute the av erage amount paid this week to our employ ees.Hint: AVERAGE is the Excel function for computing an av erage.

    Entering Formulas by Pointing

    If we ty pe in a complex formula, then we can easily ty pe in the incorrect cell reference. Most users ofExcel prefer to enter formulas by "pointing" to the cells referenced in the formula.

    Use pointing to reenter the formula used to compute our total weekly pay roll.

    Other Ways to Copy Formulas

  • 10/13/13 Spreadsheet Modeling

    13/52

    In the sheet Suppliers of the workbook Excel Formulas.xlsx we are giv en the per pound cost of purchasingSugar, butter and flour from our 6 suppliers. We are also giv en the pounds of each commodity purchasedfrom each supplier.

    In the cell range J9:L1 4 we want to compute the cost of ordering each commodity from each supplier.

    Absolute Addressing

    Let's suppose that our Praline torte, Sacher torte, and Opera torte must each hav e the same diameterand height (which we enter in cells D1 0 and D1 1 ). Also assume that the cost per cubic inch for the Pralinetorte is $0.1 0, for the Sacher torte $0.1 1 , and for the Opera torte $0.1 2. Let's create a spreadsheet (seesheet Cakecost of file Excel_Formulas.xlsx) that computes the cost of producing each ty pe of cake. Thev olume of a cake with radius r and height h is r2h. Here r = cake radius in inches and h = cake height in inches. Recall that radius =diameter/2.

    We want to enter a formula in E1 5 to compute the cost of producing the Sacher torte. Then we hope tocopy this formula down to the range E1 6:E1 7 and thereby compute the cost of producing the other cakes.Clearly our cost formula in cell E1 5 will need to depend on the diameter and height which are giv en incells D1 0 and D1 1 . The problem is that if we reference D1 0 and D1 1 in our formula in cell E1 5 and copythe formula down, then D1 0 will change in cell E1 6 to D1 1 and D1 1 will change in cell E1 6 to a D1 2reference. We do not want this to happen! The solution is to enter cell D1 0 in our formula as $D$1 0 andenter cell D1 1 in our formula as $D$1 1 . A $ sign before the row of a cell reference ensures that when wecopy the formula the row reference remains unchanged. Similarly , a $ sign before the number in a cellreference ensures that when we copy the formula the column reference remains unchanged.

    Using the F4 Key

    Suppose we had not put $ signs on the D10 and D11 cell references in E15. Then when we copied theformula to cell E16 cell E16, would contain the following formula: =PI()*(D11/2)^2*D12*D16.

    This would certainly giv e an incorrect answer.

    Hierarchy of Mathematical Operations

    The astute student is probably wondering why we used parentheses in our cell E1 5 formula, instead ofty ping the formula as:

    =PI()*($D$10/2)^2*$D$11*D15.

    Operation(s) contained in parentheses are carried out first followed by operations inv olv ing exponents.Then div ision or multiplication operations are giv en equal precedence. Operations inv olv ingmultiplication and div ision are giv en equal precedence and are then carried out from left to right.Finally , operations inv olv ing addition and subtraction are giv en equal precedence and are then carriedout from left to right.

    Without the parentheses, Excel would square 2 (obtaining 4) and then compute $D$10/4 which equals2. We want, of course, the part of our formula inv olv ing D10/2 to y ield 1 6 and not 2 . Inserting ( ) around$D$10/2 ensures that we first div ide the contents of cell D10 by 2 and then square the result (this y ields42/2 = 8, as desired).

    Summation Icon

    Now let's efficiently compute our total bill for each commodity and the total amount we need to payeach supplier. To determine the total amount we owe each supplier we could simply copy from H23 toH24:H27 the formula =SUM(E23:G23). Then we could compute the total bill for each commodity bycopy ing the formula =SUM(E23:E28) from cell E29 to the range F29:G29. There is nothing wrong withthis method but here's an easier way .

    Editing or Correcting Formulas

    Showing the Actual Formula in a Cell

  • 10/13/13 Spreadsheet Modeling

    14/52

    Do It Yourself Exercise

    Suppose our annual demand for Sacher Torte equals 7 000 minus 200 times (price of Sacher Torte).Producing Sacher Tortes incurs an annual fixed cost of $5000. Construct a table which shows how ourannual profit from Sacher Tortes v aries as the cost of producing a Sacher Torte v aries from $1 7 .00 to$24.00 and the price of a Sacher Torte v aries between $25 and $35.

    Excel Formulas Exercise Solutions

    Useful Excel Functions

    If y ou like to cook y ou know how judicious use of key ingredients is a key factor in making that perfectmeal. Similarly in Excel, mastery of Excel's many powerful functions will help y ou create that "spreadsheetmasterpiece".

    IF Statements

    Let's suppose Le Napoleon is considering three proposals for giv ing price discounts according to thefollowing guidelines:

    Proposal 1: When quantity of a product bought by a customer exceeds a giv en threshold, all unitsof that product are discounted. For example, if less than 1 00 Napoleons are bought by a customer,that customer pay s $3.50 per Napoleon. If at least 1 00 Napoleons are bought, the customer pay s$3.1 5 per Napoleon.Proposal 2: Instead of one price break point, there are two price break points. For example, if acustomer buy s fewer than 1 00 Napoleons, that customer pay s $3.50 per Napoleon. If between 1 00and 1 29 Napoleons are bought, we giv e the customer a 1 0% discount on each unit purchased. If atleast 1 30 Napoleons are bought, we giv e a 1 5% discount on each unit.Proposal 3: When quantity of a product bought by a customer exceeds a giv en threshold, all unitsof that product are discounted. For example, if less than 1 00 Napoleons are bought by a customer,that customer pay s $3.50 per Napoleon. If at least 1 00 Napoleons are bought, the customer pay s$3.1 5 per Napoleon. If a customer is a friend of an employ ee and that customer's purchasequantity exceeds the same threshold, the customer receiv es an extra 50% discount on each unitpurchased.

    You hav e been asked to set up a spreadsheet that computes (giv en the quantity purchased of eachproduct) a customer's total cost of purchasing each product.

    To accomplish this goal we will use IF formulas. IF formulas let y ou conduct conditional tests on v aluesand formulas. An IF formula begins with a condition such as A1 >1 0. If the condition is true, the formulareturns the first v alue listed in the formula; otherwise we mov e on within the formula and repeat theprocess. We now illustrate how IF formulas work by showing how to write formulas implementing pricingproposals 1 -3 .

    We now show how to compute the price paid by a customer for each product and the total amount paid ifthe pricing structure is as follows. When quantity of a product bought by a customer exceeds a giv enthreshold, all units of that product are discounted. For example, if less than 1 00 Napoleons are bought bya customer, that customer pay s $3.50 per Napoleon. If at least 1 00 Napoleons are bought, the customerpay s $3.1 5 per Napoleon. Please download file IF.xlsx.

    We see, for example, that if a customer buy s 99 or fewer Napoleons, each one costs $3.50 while if at least1 00 Napoleons are bought, the customer receiv es a 1 0% discount. Let's now write formulas that computefor each customer the unit price that customer pay s for each product and the total amount paid for eachproduct.

    We now show how to compute the price paid for each product and the total amount paid if instead of oneprice break point, there are two price break points. For example, if a customer buy s fewer than 1 00Napoleons, that customer pay s $3.50 per Napoleon. If between 1 00 and 1 29 Napoleons are bought wegiv e the customer a 1 0% discount on each unit purchased. If at least 1 30 Napoleons are bought we giv e a1 5% discount on each unit.

    We see, for example, that if a customer buy s 99 or fewer Napoleons, each one costs $3.50, while if thecustomer buy s between 1 00 and 1 29 Napoleons, the customer receiv es a 1 0% discount on each unit

  • 10/13/13 Spreadsheet Modeling

    15/52

    purchased. If at least 1 30 Napoleons are bought, the customer receiv es a 1 5% discount on each unitpurchased. Let's now write formulas that compute for each customer the unit price that customer pay sfor each product and the total amount paid for each product.

    We now show how to compute the unit price paid for each product and the total cost of each product if thefollowing price structure is used. When quantity of a product bought by a customer exceeds a giv enthreshold, all units of that product are discounted. For example, if less than 1 00 Napoleons are bought bya customer, that customer pay s $3.50 per Napoleon. If at least 1 00 Napoleons are bought, the customerpay s $3.1 5 per Napoleon. If a customer is a friend of an employ ee and that customer's purchase quantityexceeds the same threshold, the customer receiv es an extra 50% discount on each unit purchased. An x inColumn E indicates the person is a friend. Recall that in an IF statement we first check the left-hand-mostcondition. Therefore we must first check if the customer is a friend and has purchased enough to get adiscount. If so, that customer's discount is 1 .5 times the entry in column D (which we compute in columnF). If customer is not a friend who has bought more than the number needed for the discount, then wegiv e a discount equal (in percentage terms) to the entry in column D. If neither condition is true, thenthe customer is charged the full price.

    We had two ending ) in our IF statement: one to match each IF statement.When we hav e more than one occurrence of IF in a formula we refer to the formula as a Nested IFstatement .In addition to the AND operator, we can use the OR and NOT operators in a nested if statement.AnOR operator returns "true" if and only if at least one of the conditions within( ) is true. Forexample, the formula IF(OR(E2="x",G2>=C2),(1 -F2)*B2,B2) would giv e a 1 5% discount if aperson was a friend or ordered at least 1 00 Napoleons and would otherwise giv e no discount. ANOT operator returns TRUE if and only if the condition within ( ) is FALSE. For example, theformula =IF(NOT(E2=?x?),B2,IF(G2>=C2,(1 -F2)*B2,B2)) would charge full price to any one whois not a friend. Then for friends we would giv e a 1 5% discount if they ordered at least 1 00Napoleons. Otherwise, we would charge full price.

    Let's test our mastery of IF statements by try ing the following problems:

    Currently we charge $30 for a Sacher Tort and our competitor charges $25. If our competitorcharges below $20 we will lower our price to $25. Write a formula which returns our price afterwe enter the competitor's price in the spreadsheet.In the game of craps two dice are rolled with a total between 2 and 1 2 resulting. A 7 or 1 1 on firstroll results in a win, a total of 2 , 3 or 1 2 results in a loss, and otherwise the game continues. Writea formula that returns the game status after the first two dice are rolled.

    IF Statement Exercise Solutions

    Text Functions

    Often we import data to a spreadsheet from a web site or the corporate database. Many times the datadoes not look the way we want. For example, we may import the current month's sales of each productfrom a database and the data might look as follows:

    We would like to extract the number sold of each product to a separate cell. For example, put 1 7 8 in cellF3. Excel's collection of text functions helps us clean up and manipulate data that does not quite look theway we want. In this section y ou will master the LEFT, RIGHT, MID, LEN, FIND, VALUE, andCONCATENATE text functions. Please download file Text.xlsx.

    Let's now show how to extract the sales of each product to column G. The key is to find the first space andtake ev ery thing out of column E that is to the left of the first space.

    There is a problem, howev er. Looking at column G we see that all entries are left justified. This meansthat Excel will treat the contents of these cells as text, not as a number. Thankfully , the VALUE functionallows us to painlessly conv ert text to a number. Simply put between ( ) the text or cell whose contentsy ou conv erted to a number.

    Similar to the LEFT function, the RIGHT function (sy ntax RIGHT(cell, n)) will grab the right-hand-mostn characters from a cell. The LEN function (sy ntax Len(cell)) returns the number of characters(including spaces ) in a cell. In column D of the sheet Names we are giv en the names of our employ ees.

    In column G we will extract each employ ee's last name. First in column E we find the location of the spacebetween the first and last name. Then in column F we determine the number of characters in the person'sname (including the space). Finally , in column G we use the RIGHT function to extract the employ ee's

  • 10/13/13 Spreadsheet Modeling

    16/52

    last name.

    The MID function is used to extract part of a cell's contents that starts in "the middle" of the cell. Thesy ntax of the MID function is MID(cell, s, n). MID(cell, s, n) would start at character s of the giv en cell andextract the next n characters. In sheet Middle we will use the MID function and FIND function to extracteach employ ee's middle name to column.

    We will use the FIND function to find the location of the first and second spaces in the person's name. Thenwe can use the MID function to extract to column G all characters between the first and second space.This will, of course, result in column G containing each person's middle name.

    All exercises for this chapter are in the file Textexercises.xlsx.

    The sheet Movies giv es the number of copies of each mov ie in stock at a v ideo store. Put the nameof the mov ie in one column and the number of copies in the next column.The sheet ID giv es a product ID, followed by a product name followed by a product price. Extractthe product name to a separate column. The price alway s is expressed using 4 characters.

    Text Functions Exercise Solutions

    Often data comes into Excel from a web site or data base separated by commas, spaces, or othercharacters. Using Data Text to Columns it is easy to parse the data to multiple columns of cells.Worksheet Text to Columns contains each employ ee's name in cells D7 :D1 4. Our goal is to place eachperson's first name in column E, middle name in column F and last name in column G.

    In worksheet email, cells G7 :G1 4 contain each employ ee's last name. We would like to giv e each employ eean email address by appending @Napoleon.com to the employ ee's last name. This is easily done using the& sign which is often referred to as the concatenation operator. Any use of an & sign joins what comesbefore and after the & sign. If y ou want to insert text enclose the text in ".

    In sheet addresses combine the street address, state, and zip code into a single cell.

    Text Functions Exercise Solutions

    Basic Date and Time Functions

    Please download workbook Datesandtimes.xlsx. We begin by noting that if y ou bring up the Format CellsDialog box (the easiest way to do this is to hit Control+1 ), then by selecting Date or Time y ou may choosethe way y ou want dates and/or times display ed.

    Le Napoleon has entered in cells E6:E1 0 the dates certain cash flows were receiv ed. They would like toextract the month, day of the week, y ear, and day of the month into columns F-I, respectiv ely . Thefollowing EXCEL DATE functions will help us accomplish this goal. For a giv en date:

    MONTH(date) returns the date's month.WEEKDAY(date,2) returns the day of the week for the date, with 1 = Monday , 2 = Tuesday , ...7 =Sunday .YEAR(date) returns the date's y ear.DAY(date) returns the date's day of the month.

    All exercises for this chapter are in the file Datehw.xlsx.

    The file Datehw.xlsx contains the first day we sold each product and the first time of day we hav e theproduct av ailable.

    Extract the y ear, day of week, day of month, and month that we first sold each product.

    Date and Time Exercise Solutions

    Le Napoleon has entered in the range F1 4:F1 7 the time 4 employ ees began their work day . They want toextract the hour, minute and second of the start time. The following EXCEL TIME functions will help ussolv e our problem:

    For a giv en time HOUR(time) will return the hour for the giv en time.For a giv en time MINUTE(time) will return the number of full minutes after the hour for thegiv en time.For a giv en time SECOND(time) will return the number of seconds for the giv en time.

  • 10/13/13 Spreadsheet Modeling

    17/52

    Extract the hour and minute at which we hav e each product first av ailable.

    Date and Time Exercise Solutions

    The EXCEL DATE function (sy ntax DATE(y ear, month, day of month)) allows us to recreate a date if weare giv en the date's y ear, month, and day of month.

    The EXCEL TIME function (sy ntax (Time(hour, minute, second)) allows us to recreate a time giv en thehour, minutes after the hour, and seconds for the giv en time.

    There is an easy way to display the current date or current date and time in a cell. Entering the function=TODAY() (may be this used to be Katy Couric's fav orite function!) in a cell enters the current date, whileentering the formula =NOW() display s the current date and time in a cell. Observ e in cell B3 thatentering =TODAY() ensures that the current data is alway s display ed in cell B3, while entering =NOW()in B5 ensures that the current date and time are entered in cell B5.

    Finally , we note that if y ou format a date as a number or choose the General format, Excel returns thenumber of day s that the giv en date is after January 1 , 1 900. Excel giv es January 1 , 1 900, a serialnumber of 1 , January 2 1 900, a serial number of 2 , etc. If we format a time as a number, Excel returnsthe fraction of a day after midnight that the giv en time occurs. To illustrate, look at the range D5:G1 0 ofthe sheet Number.

    Note, for example, that August 1 5, 2009, is 40,040-1 day s after January 1 , 1 900. Also note that, forexample, 5:40 PM is 7 4% of the way between midnight and the start of the next day .

    Range Names

    Suppose cell B500 of y our workbook contains Le Napoleon's sales in January and cell B501 contains ourFebruary sales. If we want to compute our total sales in January and February we could enter theformula =B500+B501 . Then nobody would know what we are doing. Wouldn't it be nice (as the BeachBoy s used to say ) if the formula showed up as =JAN+FEB. In this section we will show y ou how to namecells or ranges of cells in y our spreadsheet and use the range names y ou create in y our formulas. Usingrange names often reduces the effort needed to create important formulas. More important, using rangenames makes it easier for y our colleagues to understand y our work.

    Please download files Rangetemp.xlsx and Rangehw.xlsx.

    In the sheet Name Box of Rangetemp.xls we see our January and February sales. We would like to giv ecell E5 the range name Jan (for January ) and cell E6 the name Feb (for February ). We can easily namethese cells using the Name Box (located right abov e the label for Column A).

    The worksheet Create from selection giv es Le Napoleon's sales in some U.S. cities. We would like to namethe actual sales amount in column D with the city name from column C. For example, we would like cellD4 to be named Los Angeles.

    Using the Name Box to assign the city names to each sales v alue would require that we use the Name Box24 times. There must be an easier way ! Excel's Create From Selection option allows us to create rangenames based on the text in the spreadsheet.

    How can we edit, or delete, range names? Simply use the Name Manager.

    We often analy ze data in Excel. If y ou do not name the data, then y ou must point to the data each timey ou use it in a formula. If, for example, our data is in Column A and our formula is in Column Z then eachtime we want to create a formula we must mov e back and forth between Columns A and Z. If we nameour data, we nev er need to point to the data again! In worksheet Quarterly Revenue, we list our rev enue ineach city for each quarter of the y ear. We will name each quarter of data and then compute importantstatistics for each quarter of sales.

    We can also use the Paste Names dialog box to paste a list of all the workbook's range names into y ourworksheet.

    Hopefully y ou are getting to like range names. You will probably return to spreadsheets y ou hav ealready worked on and create range names. At first glance y ou will probably be disappointed because therange names will not show up in y our formulas. To make sure y our range names are used in y ourformulas y ou need to select Apply Names from the drop down arrow in the Name Manager portion of theFormula tab. Please v iew the workbook Apply Names in Rangetemp.xlsx. This workbook computes theprofit earned from our Sacher Torte. Our formula in cell E7 for profit currently reads as =(E4-E5)*E3-E6.

  • 10/13/13 Spreadsheet Modeling

    18/52

    Using range names we would like to express this formula as =(price-unit_cost)*units_sold-fixed_cost.

    Please download file Rangehw.xlsx.

    In worksheet States, name each state's sales with the state abbrev iation. Then add upMassachusetts and New York sales.In worksheet Regions, create a name for all sales during each month and all sales in each region.Write a formula using range names that adds up all East sales and all April sales.

    Range Names Exercise Solutions

    Lookup Functions

    Please download file Lookupstemp.xlsx. Consider the following three problems:

    Problem 1: Our unit cost per clair to a customer depends on the number of clairs they order as shownin worksheet Vlookup true. Write a formula to determine the unit cost of clairs for the clients listed inthis worksheet.

    Problem 2: In sheet Vlookup false we want to determine the cost of each order. To this we must look upthe price of the products listed in A20:A28. Write formulas to determine the total cost of each order.

    Problem 3: We are charging $30.00 for a Sacher Torte during the first quarter of 201 0. During eachquarter of 201 0 we want to increase the price 5%. Write a formula that determines for any date in 201 0the price of a Sacher Torte.

    We will solv e our three problems using lookup functions. Our first two problems require the use ofVLOOKUP functions, while our third problem requires the use of HLOOKUP functions.

    A VLOOKUP (V stands for v ertical) tries to "match" a number or text string in the first column of a rangeof cells (called the table range). Then we mov e to a desired column and return the number in the desiredcolumn that is in the same row as the "match." If the first column of the table range is numbers inascending order, then we use the sy ntax VLOOKUP(lookup v alue, table range, column index).

    This formula will keep comparing the lookup v alue to the entries in the first column of the table range. Aslong as the lookup v alue is >= to the number in the first column of the table range, we keep mov ing downthe table. As soon as the lookup v alue is < the number in first column of the table range, we stop andmov e to the column index column to find the v alue returned by the lookup function. We now will use av lookup function to help us determine the total cost of each customer buy ing clairs from Le Napoleon.We hav e named our table range C4:D8 as lookcost. References to range names refer to the same range ofcells when we copy a formula. This fact ensures that when we copy our v lookup formulas we will nothav e to place $ signs on the table range.

    When the first column of the table range is not numbers in ascending order, then we should use thefollowing sy ntax for the v lookup function: v lookup(lookup v alue, table range, column index, false). Theinsertion of false ensures that the lookup function will look for an exact match to the lookup v alue in thefirst column of the table range. If such an exact match exists, then we pick off the entry in the columnindex column of the row in the table range where the lookup v alue is matched. If there is no match, thenthe Exce1 error message #N/A, which means that there is no answer or no av ailable match, will appear.

    Let's use v lookup with the false option to lookup (in worksheet v lookup false) the total cost of the productsorders based on rows 20-27 . We hav e named our table range (A3:B1 6) as lookprice.

    When we want to match an entry in the first row rather than first column of a table range, then we usean HLOOKUP (H for horizontal) function). The sy ntax is identical to VLOOKUP with row index replacingcolumn index. We now use HLOOKUP functions to solv e the following problem: We are charging $30.00for a Sacher Torte during the first quarter of 201 0. During each quarter of 201 0 we want to increase theprice 5%. Write a formula that determines for any date in 201 0 the price of a Sacher Torte.

    Our work is in worksheet Growth. We hav e named cell D1 growth and the table range C2:F3 Dateprice.

    Please download file Vlookuphw.xlsx.

    Rows 3-1 2 giv e the age and salary of some of y our friends. In rows 1 5-1 8 write formulas to entereach person's age and salary .

  • 10/13/13 Spreadsheet Modeling

    19/52

    When a customer orders < 1 00 Pear Charlottes, that customer pay s $25 per cake. When the orderis between 1 00 and 1 99 Pear Charlottes, they pay $23.00 per cake. If they order at least 200 PearCharlottes the customer pay s $20.00 per cake. Write a formula that will compute the cost ofordering any number of Pear Charlottes.

    VLOOKUP Exercise Solutions

    Other Lookup & Reference functions

    Two other useful functions in Excel's Lookup & Reference function category are INDEX and MATCH. TheINDEX function can be used to easily extract any entry from a rectangular array of cells. The MATCHfunction can be used to locate a text string in a row or column. We will soon see that together these twofunctions giv e us a great "one-two punch" that can be combined to great benefit.

    Simply stated, the INDEX function extracts an entry from a giv en row and column of a rectangulararray of cells. The sy ntax of the INDEX function is =INDEX(array , r, c.). Then the INDEX functionreturns the entry in row r and column c of the giv en array . Please download the fileIndexmatchtemp.xlsx. Worksheet Index contains the monthly sales for each product. Let's write aformula to return in cell B1 8 the sales of Opera Tortes during February .

    Write a formula that returns Vanilla clair sales during April.

    Index and Match Exercise Solutions

    The MATCH function looks to match a text string or number in a row or column. The sy ntax =MATCH(lookup v alue, lookup range,0) works as follows. If the lookup range is in a single column, the MATCHfunction finds the first occurrence of the lookup v alue and returns how many rows down the lookup v alueis in the lookup range. If the lookup range is in a single row, then the MATCH function finds the firstoccurrence of the lookup column and returns how many columns across the lookup v alue is in the lookuprange. The last argument of 0 is needed because usually our lookup range will not hav e sorted v alues. Wewill not discuss MATCH functions with last arguments of +1 or -1 since they are rarely used. As anexample of the use of the MATCH function let's find the first occurrence of Pear Charlotte in the list ofproducts in column F of worksheet Match and index. We note that if no match exists then Excel will returna #N/A error.

    What we want to do now is to write a formula which will return, for any combination of product andmonth, the sales of the product during the giv en month. For example, if we enter Pear Charlotte in cellA1 8 and February in cell B1 8, we would like to hav e a formula that returns the February sales of PearCharlotte. Our strategy will be to find the row for the product and the column for the month using theMATCH function. Then we can use the INDEX function to return the actual product sales during thegiv en month.

    Please download file Indexmatchhw.xlsx.

    The worksheet Indexmatchhw.xlsx contains our employ ees names and salaries. Write a formulathat would return the name of the employ ee with the largest salary . Hint: The MAX functionreturns the largest number in a column.Suppose we can enter an employ ee's name in cell D1 . Write a formula in cell E1 2 that returns theemploy ee's salary .

    Index and Match Exercise Solutions

    Error Trapping

    Suppose we attempt to compute av erage price as rev enue div ided by units sold. If units sold = 0 we willget a #DIV/0! error. If we write a lookup formula to return the price of a product and we misspell theproduct's name, we will receiv e a #N/A error. There are many other error messages that can pop up inEXCEL. Using the Excel IFERROR function we can replace these error messages by an explanatory textmessage. The sy ntax of IFERROR is IFERROR(excel, formula, desired message). If the Excel formulareturns a v alue without an error, then this v alue is inserted in the cell. Otherwise the desired errormessage is entered in the cell.

    Please download the file Errortraptemp.xlsx. This worksheet shows the price for each product as well asthe quantity ordered of each product. We want to determine the av erage total cost of each orderedproduct. Once we use a VLOOKUP formula to determine the unit cost for each product, cell G1 4 would

  • 10/13/13 Spreadsheet Modeling

    20/52

    determine the av erage cost of the orders. The problem is that we hav e ty ped in Napoleon in cell D1 2instead of the actual product name Napoleon (piece) so a VLOOKUP formula will y ield an error. Supposewe want to ensure that any VLOOKUP which returns an error will hav e a _ show up instead of an errormessage. To accomplish this goal we simply copy from F9 to F1 0:F1 3 the formula=IFERROR(VLOOKUP(D9,lookup,2,FALSE),"_"). Note we hav e also copied the formula=IFERROR(E9*F9,"_") to G1 0:G1 3 to ensure that no error messages show up in column G.

    Please download the file errortraphw.xlsx.

    File Errortrap.xlsx contains in columns A and B prices at which homes were bought and sold. If ahome has not y et been sold, the sell price column say s not sold y et. In column C compute the profitearned on each sold house. If a house has not been sold, y our formula should say not sold y et.

    Error Trapping Exercise Solutions

    Rounding Functions

    Often we want to round the contents of a cell up or down to the nearest integer. The Excel functionsROUNDUP, ROUNDDOWN, ROUND and INT are useful in these situations. A description of the sy ntax ofeach function follows:

    ROUNDUP(number,n) rounds the number up (away from 0) using n significant digits. Using n =0 results in the number being rounded up to the nearest integer. For example, ROUNDUP(3.2,0)returns 4 and ROUNDUP(PI(), 2) returns 3 .1 5.ROUNDDOWN(number, n) rounds the number down (toward 0) using n significant digits. Usingn = 0 results in the number being rounded down to the nearest integer. For example,ROUNDDOWN(3.2,0) returns 3 while ROUNDOWN(PI(), 2) returns 3 .1 4.ROUND(number, n) rounds the number to n significant digits. If there is a tie on which number toround to, Excel rounds to the highest number. For example ROUND(3.5,0) y ields 4. AlsoROUND(3.4,0)+ returns 3 and ROUND(3.6,0) returns 4.INT(number) rounds the number down to the nearest integer. For example INT(3.4) returns 3and INT(-4.7 ) returns -5.For positiv e numbers there is no difference between the ROUNDDOWN and INT function. Forexample INT(4.8) = ROUNDDOWN(4.8,0) = 4. For negativ e numbers, howev er, theROUNDDOWN and INT functions may y ield different results. For example INT(-4.3) = -5 butROUNDDOWN(-4.3 ,0) = -4.

    Please download the file Roundingfunctionstemp.xlsx. Suppose Le Napoleon must purchase flour in sacksweighing a giv en amount. Giv en a need for flour, how can we write a formula that tells Le Napoleon howmany sacks they need to purchase? We simply need to div ide the needed pounds of flour by the sack sizeand then use the ROUNDDUP function to round the answer up to the nearest integer. We named thenumber of pounds in a sack with the range name package_size.

    Now let's suppose when we pay a bill and are 1 full month late (1 month =30 day s) we pay a 5% penalty .If we are 2 full months late we pay a 1 0% penalty , and if we are 3 or more months late we pay a 1 5%penalty . Giv en the number of day s we are late, we want to write a formula that returns our percentagepenalty . Essentially we need to take DAYSLATE/30 and round it down to the largest integer

  • 10/13/13 Spreadsheet Modeling

    21/52

    Suppose y ou hav e the number of hours each employ ee worked this week in cells A1 :A1 0 and the numberof hours each employ ee worked in cells B1 :B1 0. You want to compute y our total pay roll for the week. Wecould of course enter the formula =A1 *B1 +A2*B2 +? +A1 0*B1 0. This would be tedious and we wouldprobably make some errors while entering this formula. Entering the formula =SUMPRODUCT(A1 :A1 0,B1 :B1 0) would be an easy way to compute our total pay roll. Usually the SUMPRODUCT function has twoarguments consisting of cell ranges hav ing exactly the same dimension. Then the SUMPRODUCTfunction multiplies the corresponding components of each cell range. If one cell range is a row with ncells, then the other cell range must also be a row with n cells. If one cell range is a column with n cells,then the other cell range must be a column with n cells. Finally , if one cell range is a range with m rowsand n columns, then the other cell range must also contain m rows and n columns.

    To illustrate the use of the SUMPRODUCT function, let's determine Le Napoleon's total pay roll for a week.Please download the file Sumproducttemp.xlsx.

    Please download the file Sumproducthw.xlsx. This file contains information on how many hours eachemploy ee worked, how many cakes they produce per hour, and the price of each cake. The file alsocontains the cost per pound of purchasing sugar, butter, and flour and the amount bought from each of LeNapoleon's six suppliers.

    Determine (with a single formula) the total number of cakes produced.Determine (with a single formula) the total rev enue generated by the produced cakes.Determine (with a single formula) the total cost of buy ing sugar, butter, and flour from our 6suppliers.

    SUMPRODUCT Exercise Solutions

    Modeling Uncertainty in Excel

    If there is one thing we know about this world, it is that we do not know what is going to happen. Forexample, Le Napoleon does not know how many Sacher Tortes will be demanded each day . Excel containssev eral functions that help us model uncertain ev ents such as the daily demand for Sacher Tortes. In thissection we will discuss two such functions: RAND() and RANDBETWEEN. In a future chapter we willstudy in more detail how to use an Excel add-in @RISK to model uncertainty . The use of spreadsheets tomodel uncertainty is often referred to as Monte Carlo simulation.

    If y ou ty pe =RAND() in any cell, y ou will see a number between 0 and 1 .

    Suppose Le Napoleon believ es there is a 30% chance that demand for Sacher Tortes today will be for 3tortes, a 50% chance demand for Sacher Tortes will be for 4 tortes, and there is a 20% chance that today 'sdemand will be for 5 Sacher Tortes. We can use the =RAND() function to generate a random demand forSacher tortes. Please download the file Randtortestemp.xlsx. The basic idea is to ensure that if our RAND()v alue is =.8 we assign a demand for 5 tortes. Then 30% of thetime this method generates a demand for 3 tortes; .8 - .3 = 50% of the time we generate a demand for 4tortes, and 1 - .8= 20% of the time we generate a demand for 5 tortes.

    Set up a spreadsheet that models the daily demand for Pear Charlotte. There is a 60% chance the demandwill equal 4 and a 40% chance the demand will equal 8.

    Modeling Uncertainty Exercise Solutions

    Another useful Excel function for modeling uncertainty is the RANDBETWEEN function. IF a and b areintegers and y ou enter =RANDBETWEEN(a,b) in a cell, then Excel is equally likely to return any integerbetween a and b inclusiv e.

    For example, suppose Le Napoleon believ es that it is equally likely that today they will sell between 1 00and 200 Napoleons. Then entering =RANDBETWEEN(1 00,200) in any cell will generate a randomdemand that reflects our v iew of what might happen.

    The demand for Praline tortes today is equally likely to be between 20 and 40. Write an Excel functionthat can be used to model the daily demand for Praline tortes.

    Modeling Uncertainty Exercise Solutions

    Excel Financial Functions

  • 10/13/13 Spreadsheet Modeling

    22/52

    In y our finance classes y ou will hav e to perform calculations inv olv ing important financial conceptssuch as Net present v alue (NPV), Internal Rate of Return (IRR), mortgage pay ment schedules, anddepreciation. Excel has many useful functions that make these computations a snap. In this section wewill discuss sev eral of Excel's important financial functions: XNPV, XIRR, PMT, and SLN.

    Consider the cash flows shown in the worksheet Financialfunctionstemp.xlsx. Please download the fileFinancialfunctionstemp.xlsx. Cells A1 :G1 0 of worksheet NPV and IRR giv e the amount and dates of cashflows for two different machines that Le Napoleon is considering buy ing.

    The question is which machine is a better buy . A nav e decision maker might say that Machine 1 isbetter because the total v alue of the rev enues less costs is $1 000, while for Machine 2 this sum is $7 60.This reasoning ignores the important concept of the time v alue of money . It is better to receiv e $1 nowthan in the future. Similarly , it is better to pay out $1 in the future than pay out $1 now. The proper wayto ev aluate projects which inv olv e cash flows occurring at different times requires us to assign adiscount rate (usually between 1 0% and 20% per y ear) that incorporates the time v alue of money . Adiscount rate of 1 0% means $1 receiv ed now is equiv alent to receiv ing $1 .1 0 a y ear from now. Div idingboth sides of this relationship by 1 .1 0 we find that $1 /1 .1 0 now is equiv alent to $1 receiv ed one y ear fromnow. Similar logic shows that $1 receiv ed 2 y ears from now is worth the same as receiv ing $1 /1 .1 2 nowand in general receiv ing $1 n y ears from now is the same as receiv ing 1 /1 .1 n dollars now, The NetPresent Value (or NPV) of a sequence of cash flows simply conv erts all cash flows to today 's dollars bymultiply ing cash flows receiv ed at time n by a factor 1 /(1 +discount rate)n which puts the cash flows intotoday 's dollars.

    If we enter the dates that our cash flows are receiv ed and the v alues of the cash flows into a spreadsheet,then the XNPV function (sy ntax XNPV(rate, v alues, dates)) will return the NPV of the cash flow v aluesbrought back to the first date. Here rate must be an annual discount rate. Let's utilize the XNPV functionto compute the NPV for Machine 1 and Machine 2. We will use the function wizard (indicated by thesmall fx icon on y our ribbon) to input our formula inv olv ing XNPV. The function wizard is a helpful aid

    that makes it easy to input the proper sy ntax for unfamiliar functions. You simply go the cell where y ouwant to enter the formula and click on the Function Wizard icon. Then select the ty pe of function (herewe select Financial) and then mov e to the list of functions. Next, ty pe in the first few letters (say XN forXNPV) of the function's name and y ou will mov e to the correct function. Then follow the prompts and theproper formula will appear in y our cell! Let's now compute the NPV for Machines 1 and 2.

    By the way a project with an NPV>0 increases the company 's v alue while a project with an NPV0 if and only if Project IRR>discount rate.

    An oil company is going to drill a well costing $50 million on 5/1 5/2009. For each of the next 20 y earsthey expect to receiv e $5 million in rev enues. Assuming each y ear's rev enue is concentrated midy ear,what is the IRR for this oil well?

    Excel Financial Functions Exercise Solutions

    Often we want to figure out the monthly pay ments in a car or housing loan. Excel's PMT function makesthis easy ! The PMT function has the sy ntax PMT(rate, nper,pv ,fv ,ty pe).

    Rate is the rate on the loan. If periods are y ears, this equals the annual rate. If periods are months,

  • 10/13/13 Spreadsheet Modeling

    23/52

    this is the annual rate div ided by 1 2.Nper is the number of equal pay ments needed to pay back loan.PV is the amount borrowed. PV should be entered with a positiv e sign since we will receiv e a checkfor the amount of the loan.FV is the amount of the ending pay ment needed to pay off the loan. If there is no ending pay ment,then FV=0. FV should be entered with a negativ e sign since we are pay ing money .Use ty pe =1 or True if the loan pay ments are made at the beginning of the month. Use ty pe = 0 orfalse if loan pay ments are made at the end of the month.

    Let's now mov e to the sheet mortgage pay ment and calculate the monthly pay ments on a 20-y ear loanwith monthly pay ments and a 6% annual rate under the following three conditions:

    End-of-Month pay mentsBeginning-of-month pay mentsEnd-of-month pay ments with an ending $30,000 pay ment

    Finally , let's compute our monthly pay ment for end-of-month pay ments when we make an endingpay ment of $30,000.

    What is the monthly pay ment (assuming end-of-month pay ments) on a 30-y ear $300,000 loan?

    Excel Financial Functions Exercise Solutions

    PV function: computes the v alue of an annuity .FV function: computes the future accumulation when a constant sum of money is deposited eachperiod.RATE function: computes the effectiv e rate giv en number of pay ments, size of each pay ment, andamount borrowed.NPER function: computes the number of periods required to pay back a loan giv en the rate, size ofpay ments, and amount borrowed.IPMT, PPMT, CUMPRINC and CUMIPMT: these functions help us calculate an amortizationschedule which determines the breakdown each period between principal and interest.

    We now describe the EXCEL SLN function which can be used to determine the depreciation amount eachperiod when straight line depreciation is used. Excel also includes the DDB function (for Double DecliningBalance depreciation), SYD (Sum of y ears Digits depreciation), and VDB (v ariable declining balancedepreciation functions). Due to lack of time we will discuss only the SLN function.

    The sy ntax of the SLN function is SLN((c, s, L). This function then computes the depreciationaccumulated each period for a machine costing $c, hav ing a salv age v alue of $s and a useful life of Ly ears. In sheet SLN we compute the annual depreciation ov er a 1 0-y ear period for a machine costing$400 hav ing a $50 salv age v alue.

    What is the annual depreciation we can charge on a $4000 machine with a salv age v alue of $500 and a5-y ear useful life?

    Excel Financial Functions Exercise Solutions

    COUNT, COUNTA, and COUNTBLANK Functions

    Often we want to count the number of cells in a range that contain numbers, numbers or text, orblanks. The COUNT, COUNTA, and COUNTBLANK functions serv e this purpose.

    COUNT(cell range) counts how many cells in cell range containing numbers.COUNTA(cell range) counts how many cells in cell range are not blank (contain text or numbers).COUNTBLANK(cell range) counts how many cells in cell range are blank.

    Please download the file Countingfunctionstemp.xlsx. Using Excel's counting functions, let's count howmany cells with numbers, how many nonblank cells, and h


Top Related