Laboratory: Spreadsheets
CSC 105 The Digital Age Spring 2009

Summary

This laboratory exercise introduces several basic operations that are commonly part of a spreadsheet.

The details of the lab utilize the Open Office spreadsheet oocalc, although many elements are common in other spreadsheets as well.

You will work through two extended examples. In the first, you are guided through basic steps at some length. In the second, you are asked to design your own spreadsheet for an application that is typical of many spreadsheet uses.

Example 1: Tracking Travel Expenses

When an individual travels for an employer or formal organization, it is common for the employer to reimburse the individual for actual expenses. Normally, the individual pays for various expenses, but keeps receipts. Upon completion of the trip, the individual fills out an expense account form and submits it to the employer. After reviewing the appropriateness of the expenses, the employer sends a reimbursement check.

Spreadsheet: Version 1

  1. Use the following steps to copy a simple, but detailed spreadsheet for a (fictional) trip into your account:

    1. Within your home directory, open a terminal window and create a subdirectory named 105 with the command:
      
         mkdir 105
      
    2. Move to this subdirectory:
      
         cd 105
      
    3. Copy the spreadsheet file to this new subdirectory as follows. (The period at the end does need to be included.)
      
         cp ~weinman/courses/CSC105/labs/travel-spreadsheet-v1.ods .
      

      Note that the cp command expects you to give the name of the file you are copying first and the new name for the file second. In this case, the final dot (.) indicates you want to use the same file name, but in your current directory.

  2. Open the OpenOffice spreadsheet (oocalc) as follows:

  3. On first using OpenOffice, you may be asked about setting up your account to run this software package. You can safely use the default options for each choice asked.

  4. Select Open under the File menu, and then open the file travel-spreadsheet-v1.ods in the 105 subdirectory of your account.

Upon opening travel-spreadsheet-v1.ods, you will see a typical spreadsheet configuration. Information is arranged in cells. Rows are labeled by numbers (on the left hand margin), and columns are labeled by letters (at the top margin). Cells (or rectangular blocks) then are labeled by a column/row combination.

Spreadsheets allow you to enter information by clicking your mouse on any cell and typing data.

  1. Click on cell B3. Note that the cell now has a box around it, and the words "Expense Description" appear in an editing box at the top of the spreadsheet.

  2. Move your mouse to the editing box, and change the wording to "Description of Travel Expense". After finishing editing, use the <Enter> key or the <Tab> key to record the change. This will also move your cursor to a new cell.

  3. In this exercise you will experiment with display formats. Click on the date "02/10/05" heading in cell A5, and then select Cells under the Format menu at the top of the spreadsheet. A dialog box labeled "Format Cells" will appear. Near the top of the dialog box, notice the set of "tabs", labeled Numbers, Font, etc. Click on the Numbers tab to bring it to the front. You should then see several alternative formats for dates. Select a different date format, and click "OK". (If the date field now shows "###", that is ok. You can fix it in the next exercise.)

  4. Change the width of a column as follows:

    1. Move the mouse to the top header line (labelled with "A", "B", "C", etc), and position it on a vertical line between two header cells (e.g., between the labels "A" and "B"). You should see the mouse icon change to a double-headed arrow.
    2. Hold down the left mouse button, and move the mouse left or right.
    3. Note which box or column changes in size.
    4. What happens if you make a column sufficiently small that the data do not fit in the space available?

Most numbers in the "Cost" column represent specific values entered by a user, in the same way that other data were entered. However, cell C31 is different. Clicking on C31 displays the expression =SUM(C6:C28) in the editing box. Here, the equal sign = indicates that the computer is to perform a computation before displaying a result in this cell.

The rest of this line shows the nature of that computation −− the machine is to compute a SUM of the cells in Column C, from rows 6 through 28.

  1. In this spreadsheet, values for Breakfast and Lunch on February 13 have not been supplied. What happens if you complete this expense listing by inserting costs in the two relevant cells in Column C?

  2. Suppose that in preparing this spreadsheet, you forgot to enter the cost of the opening reception on February 11. Click your mouse on the row label for row 18 (i.e., click directly on the "18"). The blank line before February 12 should become highlighted. Then select Rows under the Insert menu. This should insert a new row into the spreadsheet at row 18.

    1. Fill in "Opening reception" and an amount in this new line. Is this amount included in the "Total" at the bottom of the spreadsheet?
    2. Click again on the cell that computes the total. Is this the same as the =SUM you saw before? If not, how does it differ?

Spreadsheet: Version 2

Although Version 1 of the spreadsheet may serve adequately for some expense reports, employers sometimes require subtotals of expenses by categories, such as travel, meals, and lodging. In the following steps, you will use a revised spreadsheet for this purpose.

  1. Use the terminal window (and a command shown earlier in this lab) to copy the file ~weinman/courses/CSC105/labs/travel-spreadsheet-v2.ods into your 105 directory. Open it in OpenOffice.

  2. The spreadsheet has different columns for various types of expenses. Each expense is shown twice: once under the appropriate category, and once under a summary column, labelled "All Expenses".

    Review the various cells in the spreadsheet, and then answer the following questions.

    1. How are the entries in the "All Expenses" column determined?
    2. Why do you think "All Expenses" contains a formula, rather than asking the user to enter the value a second time?
    3. Notice the row of subtotals near the top of the spreadsheet. How are they computed?
    4. How is the "Grand Total" determined?
  3. As with version 1 of the spreadsheet, insert a new line for an "Opening Reception" for February 11, and add the notation "Opening Reception" and the relevant amount. If there are other changes that must be made to ensure all totals and subtotals are correct, make those changes as well.

  4. The spreadsheet has a column entitled, "Daily Subtotals". At the end of each day, this column is supposed to show the total amount the user spent on the given day. Thus, cell H13 should contain the value $409.09.

    Insert the relevant formulae in appropriate cells in Column H, so the four daily subtotals will be computed by the spreadsheet. (For a hint on how to do this, look at the formula in cell I5. Note that it starts with an "=" sign, indicating that it is a formula. It also specifies that the cells to be summed run from C5 through F5. Your formulae should use the same format, with different cell numbers.)

Many spreadsheets allow you to view some or all of the data in a graphical format. In the next few steps, you will create a bar chart displaying the expense subtotals by category.

  1. Highlight the category titles and subtotals as follows. Click on "Travel" in cell C3. Then, holding the shift key down, click on the subtotal for "Other" in cell F4. A block of titles and subtotals should now be highlighted.

  2. Select Chart... under the Insert menu. (It is almost at the bottom of the menu.) In the dialog box that appears, choose these options:

    1. Check "First row as label" (this means the category titles will be considered labels in what follows); click "Next".
    2. Choose the (default) chart type (a vertical bar chart), and for Data series, choose "Columns"; click "Next".
    3. Choose the (default) vertical bars, check the box for "Show text elements in preview" (near the lower left of the dialog box), and click "Next".
    4. Enter "Expenses by Category" in the box for the Main Title, and click "Create".
  3. At this point, a chart should appear. You can move the chart to a better location as follows. Click on the anchor icon near the upper left corner of the chart, select Cut under the Edit menu, click in cell L5 to the right of your data, and then select Paste under the Edit menu.

  4. Be sure to save your work!
  5. Experiment by creating at least one other other "Chart" type to explore various types of graphs and charts that can be easily generated for these data.
  6. Finally, we can prepare to print the spreadsheet.

    1. Select Page Preview under the File menu.
    2. You will probably find that your spreadsheet does not fit nicely onto the page. To fix that, find and click the Format Page button on the toolbar at the top of the screen. On the Page tab, select "Landscape" and click OK. Now most of your data should fit nicely on page 1, and your chart should be on page 2. You can check that with the Previous Page and Next Page buttons on the toolbar.
    3. When you are satisfied, click Close Preview.
    4. Select Print from the File menu.
    5. In the dialog box that appears, select the printed named Duerer. Then click on the Properties button. Another dialog box should appear, and here you should select "Landscape" under Orientation, and "Long Edge (Standard)" under Duplex. Now click OK once to close the "Properties of Duerer" dialog box.
    6. At this point, if you really wanted to print the spreadsheet, you could do so by clicking OK a second time. Instead, please click Cancel. (But keep these steps in mind, because I may ask you to print your spreadsheet from Example Two below.)

Example 2: Finances for an Individual, Club, or Student Organization

The ideas described for a travel-expense report apply to many common tasks. One common application involves budgeting for an individual, club, or organization. In what follows, you are to choose a client (yourself), a club, an organization, or some other group. The group may be either real or fictitious. In planning, it is common to anticipate likely income and expenses for the client, to determine what programs/activities are feasible. If programs will cost more than available income, then either income must be increased, or expenses cut. This represents a fundamental approach of budget preparation for both individuals and organizations.

  1. Create a spreadsheet that shows a possible budget for the client for an interval of time (e.g., a month or a year). Although the details clearly depend upon the client, your spreadsheet should contain at least the following elements.

    1. One part of the spreadsheet should contain "receipts" or "income". This should show all revenue expected for the time interval. Individual sources of income (e.g., dues, fundraisers, gifts) should be estimated, and this section should conclude with a "total receipts" or "total income" cell.
    2. One part of the spreadsheet should contain expected "expenses". This should show anticipated programs or activities of the client and their anticipated costs, together with a cell for "total expenses".
    3. A final part of the spreadsheet should show "surplus" −− that is, the computed amount "total receipts" − "total expenses".

    For this lab, you need not provide an in-depth budget plan for a client. However, your budget spreadsheet should contain at least two sources of income, at least four types of expenses, and at least one graph showing the relative amounts of income types or expense types (or both).

    You should endeavor to make the spreadsheet attractive and easily readable.

written: Henry Walker, March 9, 2004
Revised: Henry Walker, February 16, 2005
Marge Coahran, January 29, 2008
Jerod Weinman, December 31, 2008
Adapted from Spreadsheets