Information Technology Topic

Multiple Worksheets and Importing

  1. Read notes
  2. Flashcards
  3. Quiz
  4. Confident

Study focus - 3 things

  1. A spreadsheet file can hold several worksheets: give them meaningful names, and use a formula with the sheet name followed by the cell address to pull a figure from one sheet into another
  2. Importing a table of data usually means opening a CSV file, where each line is a row and the cells are separated by a comma or another character: choose the right separator and starting row
  3. Graphics can be inserted from a file as embedded images (part of the spreadsheet file) or linked images (separate files that must travel with it)

Section 1Why more than one worksheet?

One spreadsheet file can hold several worksheets, and you move between them using the tabs at the bottom of the window. Each worksheet is its own grid of rows and columns. Using separate sheets keeps different sets of data apart and tidy. A business with three branches can keep one sheet for each branch, and a school can keep one sheet for each class. The sheets stay in one file, so formulas on one sheet can use figures from another. That is what lets you build a summary sheet that combines the rest.

Section 2Managing sheets

A new sheet is added with the add button beside the sheet tabs. Sheets can be renamed, moved, copied, hidden and deleted. Give each sheet a meaningful name. Kingston, MoBay and Mandeville tell you what is inside; Sheet1, Sheet2 and Sheet3 do not, and it is easy to open the wrong one. Hiding a sheet takes it out of view but keeps it in the file. Deleting a sheet removes it, along with its data. Here's the trick: name your sheets before you start writing formulas that refer to them. The name becomes part of the formula.

Section 3Linking worksheets with a formula

A formula can use a cell from another worksheet. The reference includes the sheet name followed by the cell address. In this topic we write it as the sheet name, a full stop, then the address: Kingston.B2 means cell B2 on the sheet named Kingston. The punctuation between the name and the address depends on the package, so check the one you use. Many other packages put an exclamation mark there instead, as in Kingston!B2. The formula goes into a cell on a different sheet from the one it reads. A summary sheet might hold =Kingston.B2+MoBay.B2+Mandeville.B2. Because the formula points at cells, not copies of numbers, the result changes by itself when a branch figure changes.

Section 4The branch and summary pattern

A common design is to make identical sheets for each branch (same layout, same cells for the same items) and then one combined sheet. Each cell in the combined sheet adds the same cell from every branch sheet. For example, if Rice sales are in B2 on every branch sheet, the combined sheet's B2 is =Kingston.B2+MoBay.B2+Mandeville.B2. Type it once, then copy it down the same sheet; the row numbers change as they do for any relative address, and the sheet names stay. Use the same layout on every sheet. If Rice is in B2 on one sheet and B3 on another, the formula will add the wrong cells. Watch out: check one total by hand. Add the branch totals and make sure they equal the grand total.

Section 5Importing a table of data: CSV files

Data often arrives as a text file. A CSV (comma-separated values) file is a plain text file where each line is a row and the cells in that row are separated by a comma or another character. When you open a CSV file in a spreadsheet, an import dialog appears. You choose the separator, the character set and the starting row. The separator tells the spreadsheet where one cell ends and the next begins. The character set is the code the file uses for its letters and symbols; the default is usually right. The starting row is the line the import begins from, so lines above it are skipped. The line Cement,20,1450 becomes three cells when the separator is a comma. If the separator is set to a character that is not in the line, say a semicolon, the whole line stays in one cell.

Section 6Inserting a sheet and importing graphics

A whole sheet can also be inserted from another spreadsheet file. The sheet comes in with its table of data, ready to use in the current file. Graphics are inserted from a file. An embedded image becomes part of the spreadsheet file, so the picture travels with it. A linked image stays as a separate file, and that file must travel with the spreadsheet or the picture will be missing. Easy to mix up: embedded means 'inside the file', linked means 'a pointer to a separate file'. Emailing a spreadsheet with a linked picture, without the picture file, is a classic way to lose the picture.

Section 7Keeping links safe

Moving or copying sheets between files can break formulas that are linked to the original location, because the formula may still be looking for cells in the old place. Check the totals after moving a sheet. A good routine for combining branch data: (1) make and name a sheet for each branch; (2) use the same layout on every sheet; (3) build the combined sheet with formulas, not typed numbers; (4) check one total by hand. For imported data, check the first and last rows, count the columns, and confirm the numbers are numbers before you calculate with them.

Examples

A wholesale business has three branches. Each has a sheet named Kingston, MoBay or Mandeville, with the same layout. Weekly sales in J$ are in B2 (Rice), B3 (Flour) and B4 (Sugar). Kingston: 4200, 3100, 2500. MoBay: 3800, 2900, 2200. Mandeville: 2600, 1900, 1500. (a) Write the formula for the Rice total in B2 of a sheet named AllBranches. (b) State the formulas and values in B3 and B4 when it is copied down, and the grand total in B5 using =SUM(B2:B4). (c) The Kingston Rice figure is corrected from 4200 to 4500. State the new values in B2 and B5.

(a) Add the same cell from each branch sheet: =Kingston.B2+MoBay.B2+Mandeville.B2. Check it: 4200 + 3800 + 2600 = 10600. (b) Copied down, the row numbers change and the sheet names stay. B3: =Kingston.B3+MoBay.B3+Mandeville.B3 = 3100 + 2900 + 1900 = 7900. B4: =Kingston.B4+MoBay.B4+Mandeville.B4 = 2500 + 2200 + 1500 = 6200. B5: =SUM(B2:B4) = 10600 + 7900 + 6200 = 24700. Check by hand with the branch totals: Kingston 9800, MoBay 8900, Mandeville 6000, and 9800 + 8900 + 6000 = 24700. The two routes agree. (c) The formula in B2 reads the Kingston sheet, so it updates by itself: 4500 + 3800 + 2600 = 10900. The grand total rises by 300 to 24700 + 300 = 25000. Nothing on AllBranches had to be retyped.

A hardware store in Spanish Town is sent a text file with these six lines: Hardware stock list Item,Qty,Price Cement,20,1450 Nails,50,300 Paint,8,3200 Hose,12,950 (a) The file is opened as a CSV with a comma separator and a starting row of 2. State how many rows and columns of data are imported, and how many cells. (b) State what the import would look like if the separator were set to a semicolon. (c) After the import the headings are in row 1 and the records in rows 2 to 5. In D2 the store types =B2*C2 and copies it down to D5, then types =SUM(D2:D5) in D6. Find D2 to D5 and the total. (d) The store adds its logo to the sheet and will email the file to a supplier. Say whether to embed or link the image, and why.

(a) Starting row 2 skips the title line. That leaves the heading line and four record lines: 5 rows. Each line has two commas, so it splits into 3 cells: Item, Qty and Price. Cells imported = 5 × 3 = 15. (b) There are no semicolons in the file, so no line is split. Each line stays in a single cell in the first column: 5 rows with 1 cell each. When whole lines pile up in one column, the separator is the first setting to check. (c) D2: 20 × 1450 = 29000. D3: 50 × 300 = 15000. D4: 8 × 3200 = 25600. D5: 12 × 950 = 11400. D6 = 29000 + 15000 + 25600 + 11400 = 81000. (d) Embed it. An embedded image becomes part of the file, so it arrives with the email. A linked image is a separate file, and the supplier would see a missing picture unless that file was sent too.

Now let's water it

Session runs notes to flashcards to quiz back-to-back.

Where this comes from