• Like
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
2,060
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
121
Comments
0
Likes
3

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Guide to Excel
  • 2. ContentsPreface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v1 Getting started with Excel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 What is a spreadsheet? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 A trip around the interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Opening, saving, closing, reopening . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Working with worksheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Bending Excel to your will. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Adding document details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Shortcut keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17 Getting help on Excel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 Working with spreadsheet data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 How Excel interprets data entries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Editing cell data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 Searching for data, replacing data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Sorting data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .363 Using spreadsheet formulae . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Using Excel formulae . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Using relative and absolute cell references . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Using mixed cell references. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Understanding Excel error messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Using conditional functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504 Improving a sheet’s appearance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Setting display formats for data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Setting display formats for text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Using cell borders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65
  • 3. iv Contents Protecting a sheet’s contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 5 Working with charts and graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 What’s a chart, what’s a graph? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 Creating a simple chart. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Creating other types of chart. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 Adding legends to your chart or graph. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 Editing charts and graphs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 Copying and moving charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Adding charts to Word documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 6 Preparing and printing data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 How Excel prints workbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 Preparing a worksheet for printing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 Printing a worksheet or workbook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 Saving Excel data using different file types . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 Glossary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
  • 4. PrefaceT hese self-paced units aim to provide you with all the information you need to train yourself in basic Excel skills. They do this by covering Excel in six individual steps. At the end of each step, you have an opportunity to pause and review what youhave learned. To help you pace your study to suit your available time and circumstances,each step is self-contained.What do you need?To make use of the material, you need access to a personal computer running MicrosoftWindows XP on which a copy of Microsoft Office XP Professional or Microsoft Excel 2002has been installed.OverviewWe have tried to design the steps so that many of them can be completed in a minimum ofabout thirty minutes, although a few are more complex and may take longer.Steps 1–6 cover working with data in spreadsheets, using predefined formulae, sprucing upthe appearance of a spreadsheet, for example for a presentation, working with charts andgraphs, and finally preparing and printing spreadsheet data.
  • 5. vi PrefaceLayout and featuresYou shouldn’t try to get through all the steps Notewithout a break. After each step there arequestions you can use to check your knowledge It’s important to remember this.and to practise what you have learned.The book also gives you signposts to help you Tipkeep track of your progress and to highlightinteresting or important points. To allow you to This can make your life easier.chart your progress, you’ll find icons like this inthe margin to show you how far you have Warningprogressed through each step. Be aware of this.We also use the panels shown on the right tohighlight special or important pieces ofinformation. Stop! Don’t do this.Conventions used in the stepsApart from the graphics mentioned above, thefollowing conventions are used in the steps:■ To indicate a choice from a menu, we use the ➪ character, as in: Choose File ➪ Save to save your work.■ To indicate text that you must enter, for example into a dialog, we use a different font, like this: Enter =$G$5 in the second cell■ We also use the same font to indicate multiple lines of text you must enter. For example: Enter the following information into column A: Mary Joe Peter Frank Sue■ To indicate keys that you must press, for example when entering data into a spreadsheet, we use a bold coloured font, like this: Enter Eggs Tab 1.25, then press Return Here ‘Tab’ means press the Tab key.■ To show a new term that’s defined in the glossary at the back of the book, we put it in italics.
  • 6. Getting started STEP with Excel 1 Checklist ■ Introduction to spreadsheets ■ Excel’s basic user controls ■ Creating, opening and saving workbooks ■ Working with worksheets ■ Customising Excel ■ Getting helpT he next program in the Microsoft Office suite you are going to learn about is Excel. This step is aimed at giving you a first taste of what a spreadsheet is and what you can do with it. The steps that follow go into more detail about working withspreadsheet data, charts and graphs, as well as preparing spreadsheets for printing.What is a spreadsheet?Just as a word processor is a tool for working with words, a spreadsheet is a tool for workingwith numbers—although not only numbers.Why would you want to do that? There are few aspects of business that don’t involveworking with numerical data in some way. Although formal accounting is done using special-purpose software, there is still a huge amount of calculation, prediction, costing, estimationand so on in the work of most businesses. This is where spreadsheets excel (no punintended).The term ‘spreadsheet’ comes from traditional accounting practice. It was used to describethe format used in book-keeping ledgers, in which expenditure categories were arranged as
  • 7. 2 Step 1—Getting started with Excelcolumns, and amounts were added in the relevant columns, with each row representing atransaction. This organisation of rows and columns is carried over into today’s software.But what exactly is a spreadsheet? If you start a program such as Excel, you seesomething like Figure 1.1. Do it now using Start ➪ All Programs ➪ Microsoft Excel . Itlooks a bit like a table, and that’s a useful way of thinking about it. Figure 1.1 A blank Excel documentLook at the blank document on your screen. As you can see, it is divided into cells, each ofwhich corresponds to the intersection of a column (A–K in the picture) and a row (1–22).First of all, we’ll consider what a cell is and what it can do. We’ll do this by analogy:■ Suppose first that you want to add some numbers. You would probably do this by finding a pocket calculator and using it to add the numbers.■ Suppose however that instead of adding a few numbers, you wanted to solve a fairly complicated calculation, such as working out the total cost of a loan with compound interest (or any other complex calculation you like to think of). Clearly now your simple pocket calculator, while it helps you with addition, subtraction, multiplication and division, is not enough by itself. The least you will have to do is use a pencil and paper as well to write down intermediate totals.
  • 8. What is a spreadsheet? 3■ At this stage you might go off and find a programmable calculator, and write yourself a little program to work out your calculation—although this might take you longer than the method above!■ Now suppose that you want to do this complex calculation many times, using different sets of numbers, perhaps experimenting with different interest rates or repayment periods for a loan?Enter the spreadsheet. Every cell in a spreadsheet is like that programmable calculator!Every cell can contain any formula, of almost any complexity, and reference numbers inother cells. This means that once you have defined your formula, merely changing thenumbers in the other cells allows you to freely experiment with your data, instantly.A cell is not restricted to numbers. In fact, a cell can contain any of:■ Text■ Numbers■ Logical values (true or false)■ Formulae (that is, calculations), which include references to other cells.The best way to see how this works is to try it. You’ve already opened a blank Exceldocument. Now try this:1. You’re going to create a simple shopping list. Click in any cell to start—say B5. That’s the cell where the B column intersects row 5. (All cells are equal, so you can start at A1 if you like—it doesn’t matter.)2. Enter Eggs Tab 1.25, then press Return. Notice that the cell below your starting cell is now highlighted. This is because Excel has decided—because you pressed Return—that you are probably entering a list of items.3. Enter Flour Tab 1.1 Return Potatoes Tab 0.85 Return Meat Tab 2.26. Here’s what things should look like now.4. “So what?”, you may be thinking at this stage. Now click in the cell two below Meat and type Total Tab.5. Now enter the following carefully in the highlighted cell: =SUM(C5:C8) Return, where C5 and C8 are the cells of the first and last numbers in your list. Can you see what’s happened?
  • 9. 4 Step 1—Getting started with ExcelLet’s explain what’s going on here. Entering ‘=’ as the first item in a cell tells Excel that youwant that cell to contain the results of a calculation. SUM(C5:C8) is an Excel function,which tells Excel to calculate the total of all the numbers in the cells between and includingcells C5 and C8, that is: C5 + C6 + C7 + C8and display the result in the cell that contains the function. We will go into more detailabout functions in Step 3.You may still be wondering what all the fuss is about. But now go back to your shopping listand try entering different values for the costs of individual items. Can you see that the totalupdates itself automatically? Now imagine a large sheet with much more complexcalculations and many more totals—change any input information, and all the calculationsare updated automatically, just as with this simple total. Now imagine the results plotted ona graph within the spreadsheet, and seeing that updated automatically. That is where thepower of a spreadsheet program lies.That, in essence, is what spreadsheets are all about—ensuring that calculations of almost anycomplexity only have to be defined once, but can be repeated endlessly just by entering newnumbers.Keep your shopping list open, as we’ll use it again shortly.Some clarity and some confusionSo far we’ve been referring to Excel as a ‘spreadsheet’, or ‘spreadsheet program’. This isbecause ‘spreadsheet’ is the term in common use. In fact the term Excel itself uses isworksheet, usually shortened to sheet. A new Excel document, by default, contains threeworksheets—for no particular reason other than it’s more than two and less than four—andthe entire document is referred to as a workbook. These are the terms we will use from nowon.You can see this if you look at the open Excel document on your screen—it lists Sheet 1,Sheet 2 and Sheet 3 on the tabs at the lower left. Later we’ll see why having multipleworksheets in a workbook can be useful, but for the moment just note that:■ All the worksheets in a workbook are identical and equivalent■ Any cell in a worksheet can reference any other cell in the worksheet■ Any cell in a worksheet can reference any cell in any other worksheet.In fact, any cell in any workbook can reference any cell in any other workbook too, but that’sfor later.
  • 10. A trip around the interface 5A trip around the interfaceFigure 1.2 shows a labelled version of Figure 1.1, and below we’ll explain the purpose of themajor controls. This time we’ve re-enabled the task pane using View ➪ Task Pane. Menu bar More tools hiding here… Help …and here The formatting toolbar Formula bar Cell selector The standard toolbar Column titles Task pane Row titles Vertical scroll bar (obscured by task pane) Worksheet selector widgets Worksheet tabs Horizontal scroll bar (obscured by task pane) Figure 1.2 Excel’s user interfaceTravelling around the figure clockwise:■ The cell selector allows you to highlight any cell by name. This is often faster than scrolling around a large worksheet. Try entering a few values now: B5, C7, C10.■ The menu bar houses most of Excel’s commands. Click on each one now to see the commands it contains: File Saving and printing Edit Cutting and pasting, filling and clearing cells, deleting cells, columns and rows, searching View Viewing a document in different ways, enabling and disabling toolbars, headers and footers
  • 11. 6 Step 1—Getting started with Excel Insert Inserting cells, rows, columns, worksheets, charts, functions, objects, diagrams Format Applying styling and formatting to cell contents, rows and columns, defining styles Tools Checking spelling, mathematical consistency, protecting cell contents and whole sheets, high-level tools, options Data Sorting, filtering, grouping, data tables Window Handling multiple windows plus of course a Help menu. Some of the above will be unfamiliar to you—don’t worry. Excel contains some very high-powered mathematical tools indeed, but you don’t need to know about them at this stage.■ The formula bar provides you with somewhere to edit the data in a cell when the cell is highlighted, a real help when you are working with long formulae.■ Column titles are alphabetic, starting A, B and so on, through AA, AB to IV, 256 in all.■ The toolbars—Figure 1.1 shows two of Excel’s toolbars, the Standard toolbar and the Formatting toolbar, displayed on the same row. We’ve shown it like that because that’s the default, but you can display the toolbars in full on two separate rows if you want. Excel’s toolbars, of which there are many, are designed to give you quick access to often-user commands. You can create your own toolbars, too, just as you can with Word.■ The task pane is displayed here because we’ve just done a File ➪ New command.■ The horizontal scroll bar allows you to move forward and backward through the columns in a worksheet.■ The vertical scroll bar (here obscured by the task pane) allows you to scroll a worksheet vertically through its rows.■ The bottom border of the window contains information about the status of the current cell. It displays Enter if you are typing data into a cell, otherwise it displays Ready. Tips are also displayed here when you are engaged in an editing task such as copying a group of cells.■ The worksheet tabs allow you to switch between the different worksheets in a workbook.■ The worksheet selector widgets allow you to scroll the worksheet tabs if necessary.■ Row titles are numeric, from 1 through to 65,536—that’s 16 million cells to a single worksheet!
  • 12. A trip around the interface 7As with your work with Word, this may seem a lot to remember. Don’t worry—it willbecome more familiar as you work with the application.Enabling and disabling toolbarsExcel has twenty-nine toolbars, most of which are for special purposes. Those that you willprobably find most useful initially are the Standard, Formatting, Tables and Borders andDrawing toolbars.Here’s how to enable, disable and move them:1. With your shopping list document still open, select View ➪ Toolbars. Here you can selectively enable or disable toolbars as you need to. The Custom… setting is where you can build your own toolbars.2. Release this menu option, then click and hold on the menu bar. The mouse cursor changes to Drag downwards—the menu bar and the other two toolbars change position. Click and drag again to restore them. This is how you rearrange toolbars. (Remember from your work with Word that Office applications treat the menu bar as just another toolbar.)3. Now right-click in the blank area at the right of the menu bar. The toolbars menu is displayed—this is a shortcut that has the same effect as selecting View ➪ Toolbars. Try deselecting the Formatting toolbar. Now you can see all the tools on the Standard toolbar. Repeat the process to redisplay the Formatting toolbar.4. Click on either of the toolbar options widgets to display the tools in the toolbar that are obscured. Try selecting Show buttons on two rows to see the effect.This short exercise should give you an idea of how you can customise the toolbars to suitthe way in which you want to work with Excel. There’s more about toolbars later in thisstep.Using different viewsExcel allows you to use zooming to change the magnification of your worksheet in much thesame way as Word does with documents. The zoom/magnification setting applies to thecurrent worksheet only. Try this:1. Using your shopping list document as an example, right-click to the right of the menu bar and deselect the Formatting toolbar. You can now see all the tools on the Standard toolbar, which includes the zoom field.2. Try selecting different zoom values. The Selection value zooms the view to the size of the currently-selected cells, if any.3. Now select View ➪ Full Screen. Excel zooms the sheet to take over the whole area of your screen. It also displays a small floating toolbar to allow you to close this view mode.
  • 13. 8 Step 1—Getting started with Excel Full screen viewing is useful when you are Tip working with large worksheets, or if you are working only in Excel. A quick way to scroll around a4. Now select File ➪ New and click on Blank worksheet is to click in a cell near the workbook in the task pane to open a new top, bottom or side of the sheet and blank workbook. drag in the direction you want to scroll. Excel moves the hidden cells5. Select the Window menu. Note that Excel into view as you do so. now has two workbooks open within the same application window. The Window menu allows you to switch between them.6. Close the blank workbook using the close Warning icon in the workbook window—not the entire application’s close icon. Note that Excel has two Close icons, one for the foreground workbook, andLocking rows and columns one for the entire application window. Don’t confuse them.Much of the work you will do in Excel consists ofhandling tables of information. If you use a rowat the top of a worksheet for titles, it’s really useful to be able to keep that on screen whilescrolling the worksheet. Here’s a short exercise that demonstrates how to do it:1. Select File ➪ New and click on Blank workbook in the task pane to open a new blank workbook.2. Click in cell A1 and then enter: Title A Tab Title B Tab Title C Return to simulate the start of a table of data.3. Add some numbers to cells A2 to C8—it doesn’t matter what they are.4. Click on the row title for row 2, then select Window ➪ Freeze Panes. Excel places a line below row 1 to indicate that this row is locked on screen.If you now scroll the worksheet using the vertical scroll bar, you will see that the title rowremains locked on screen. Remember:To lock a row Select the row below the row you want to lock, then select Window ➪ Freeze PanesTo lock a column Select the column to the right of the column you want to lock, then select Window ➪ Freeze PanesTo unfreeze panes, select Window ➪ Unfreeze Panes .
  • 14. Opening, saving, closing, reopening 9Opening, saving, closing, reopeningIf you worked through the steps on Microsoft Word, you’ll be familiar with the operationsof opening, saving and closing documents. Excel is very similar.Assuming you have your shopping list example worksheet open, try the following:1. Select File ➪ Save. Excel displays its Save As dialog, which is the same as Word’s. It’s shown in Figure 1.3. As with Word, Excel defaults to your folder My Documents, but gives the workbook the default name of ‘Book 1’. Figure 1.3 Excel’s Save As dialog2. Enter ‘Shopping List’ in the File name field. Remember that you can use the Save in field to specify a different location to save the workbook. Notice the widget to the right of the Save as type field. This allows you to select file types other than the default, which is Microsoft Excel Workbook .3. Finally, click on Save, then close Excel by selecting File ➪ Exit or by clicking on the application window’s close icon .4. To re-open your file, select Start ➪ My Documents and double-click on the workbook you just saved, or select Start ➪ My Recent Documents and select the workbook you just saved.After you have named and saved your workbook, selecting File ➪ Save again saves theworkbook without requesting a name (it already has one). If you want to save a copy of theworkbook under another name, select File ➪ Save As… This displays the dialog shown inFigure 1.3 again, allowing you to supply a new name for the copy of the document.
  • 15. 10 Step 1—Getting started with ExcelExcel’s alternative file typesExcel offers a variety of alternative file types in addition to Workbook. Other file typesinclude Web page format and text. You need to know about several of these. For themoment, be aware of the fact that there is a Save as type field in the Save As dialog—we willreturn to alternative file types in Step 6.The alternative format that is likely to be most Tipuseful to you is Template. Excel templates provide you with an easy way to create new workbooksWorking with worksheets with the same formatting and layoutYou have already seen how a default workbook as an original. If you are likely to wantcontains three worksheets. You might be to create several workbooks with thewondering at this stage why you would want same formulae and layout, it’s worthmore than one worksheet. Here are a few things saving the first one as a template.you can use separate worksheets for:■ Keeping related sets of data together, for example expenditure figures for each month of a financial year, one month per worksheet.■ Storing and accessing ‘look up’ data that you don’t want cluttering up your main worksheet, for example currency conversion rates.■ Using a second worksheet to hold complex calculations, and using the first, or ‘front’, worksheet to present only important data and results.We’ll do a few short exercises to show you how to manipulate whole worksheets. Use yourshopping list example, or a blank worksheet—it’s up to you.Adding a new worksheetTo add a new worksheet, do this:1. Right-click on any of the existing worksheet tabs.2. Select Insert… from the pop-up menu. Excel displays the Insert dialog, as shown in Figure 1.4, which lists all the installed Excel templates.3. Select Worksheet and click on OK.The new worksheet is always inserted before the worksheet whose tab you selected. Tomove the new worksheet, do this:1. Right-click on the worksheet tabs of the worksheet to be moved.2. Select Move or Copy… Excel displays the Move or Copy dialog, as shown in Figure 1.5.
  • 16. Working with worksheets 11 Figure 1.4 Excel’s Insert dialog Figure 1.5 The Move or Copy dialog3. Select (move to end) and click on OK.Excel moves the selected worksheet to the end of the list of worksheets.Renaming a worksheetWhen you first start Excel, the default worksheets are called Sheet 1, Sheet 2 and Sheet 3.This is not really very descriptive, but fortunately it’s easy to rename them. To do this:1. Double-click on the name in the worksheet tab. Excel highlights the worksheet’s name.2. Enter a new name.3. Click anywhere outside the worksheet tab to deselect it.
  • 17. 12 Step 1—Getting started with ExcelDeleting a worksheetAs you have probably noticed by now, the worksheet tab pop-up menu has a Delete option.If the worksheet is not empty, Excel displays the following warning dialog when youselect it. Figure 1.6 Deleting a non-empty worksheetClick on Delete to delete the worksheet. WarningCopying a worksheet to another Once you click on Delete, the data thatworkbook the sheet contained is gone for good— there is no Undo operation!To carry out this exercise, you first need tocreate a new workbook. To do this:1. With your shopping list example workbook open, select File ➪ New. Excel displays the New Workbook task pane.2. Click on Blank workbook in the task pane.You now have two workbooks open in Excel. The new one, which Excel has called ‘Book 1’,is probably obscuring your original workbook. To bring the original workbook to theforeground, either click on its title bar or select it using the Windows menu.To copy the first worksheet from the shopping list to the new workbook, do this:1. Right-click on the worksheet tab labelled Sheet 1 in the shopping list workbook.2. Select Move or copy… Excel displays the Move or Copy dialog, as shown in Figure 1.5 on page 11.3. Select Book 1 from the To book pop-up menu.4. Click in Create a copy to enable this option, then click on OK.Excel copies the selected sheet to the new blank workbook. Figure 1.7 shows the result. Touse the same procedure to copy a worksheet within a workbook, don’t make any selectionin the To book pop-up menu.
  • 18. Bending Excel to your will 13 Figure 1.7 Worksheet after copyingBending Excel to your willAs with Microsoft Word, many features of Excel are customisable. This section lists a fewof the things you might want to change, and also gets you familiar with how to changeExcel’s many options. Many, but not all, of these options lurk behind the Tools ➪ Optionsand Tools ➪ Customize commands. Take a look at what’s there while you follow thefollowing simple exercises.Partial or full menus?By default Excel only displays partial menus, which adapt to list the commands you usemost often. This is to make it easier to use on monitors with small screens (presumably).However, menus tend to be easier to use if commands stay in the same relative position inthe menu.
  • 19. 14 Step 1—Getting started with ExcelHere’s how you turn this feature off, so that you get whole menus all the time:1. Select Tools ➪ Customize…2. Click on the Options tab.3. Click in Always show full menus to enable the option. Note in passing that there’s an option here to control whether the Standard and Formatting toolbars are shown on one row or two.4. Click on Close.From now on, you’ll always get whole menus unless you disable the option again.Disabling automatic recalculationBy default, Excel recalculates all formulae every time you change any data in a worksheet.For complex calculations or big worksheets, this may slow down your editing.Here’s how to change the automatic recalculation option:1. Select Tools ➪ Options… and select the Calculation tab.2. Click in Manual to enable this option.3. Click on OK.Excel will now only perform a recalculation of the formulae in the current worksheet whenyou press the F9 key, rather than whenever you enter new data.Setting the default location for documentsBy default, Excel will offer you your My Documents folder in open and save dialogs. If thisis ok for you, you don’t need to change anything. If you decide that you want a differentdefault folder, here’s how to change it:1. Select Tools ➪ Options.2. Click on the General tab.3. In the Default file location field, enter the full pathname of the folder you want to use as the default for your Excel document.4. Click on OK to close the Options dialog.Now, whenever you save a new workbook, or use the File ➪ Save As… or File ➪ Open…commands, Excel will offer you the folder you have chosen as the default location.Using and customising Excel’s toolbarsAs with Word, Excel displays the Standard and Formatting toolbars by default. It displaysother toolbars in specific circumstances, such as the Drawing toolbar if you insert a drawinginto a worksheet. In Office XP Excel has twenty-nine toolbars, plus the menu bar, and on
  • 20. Bending Excel to your will 15top of that, you can create your own. Many of Excel’s toolbars are for special purposes, andyou are only likely to come across them if you start using Excel for complex mathematicalor financial work.If you are a ‘visual’ person, someone who works easily with icons, toolbars will be useful toyou. Not everyone is, so you need to know how to control Excel’s toolbars so that you canadapt it to match the way you want to work. The following sections are very similar to thoserelating to Word’s toolbars, but we repeat them here so that you can refresh yourknowledge.Displaying a toolbarTo display a concealed toolbar, select View ➪ Toolbars… and then select the toolbar youwant to display. The usefulness or otherwise of the various toolbars will become clearer asyou work with Excel.Notice that toolbars can be fixed or floating:■ To ‘park’ a floating toolbar at the top or bottom of the screen, click on its title bar and drag it to the position in which you want it.■ To float a ‘parked’ toolbar, hold down the Ctrl key, click in the toolbar and drag it free.Setting toolbar defaultsIf you find yourself working with the same toolbars all the time, you can tell Excel to displaythem by default when you start it. To do this:1. Select Tools ➪ Customize…2. Click on the Toolbars tab if it’s not already displayed.3. Click to select the toolbars you want. Notice that there are toolbars here that aren’t even displayed in the View menu!4. Click on Close.Excel displays the toolbar(s) you have chosen, and will also redisplay them the next timeyou start up the application.Customising a toolbarTo complete our discussion of toolbars, we’ll see how easy it is to add or remove commandsfrom them:■ To remove a button from a toolbar, hold down the Alt key, click on the button you want to remove, and drag it off the toolbar.
  • 21. 16 Step 1—Getting started with Excel■ To add back the default buttons, click on Note the toolbar options widget and select Add or Remove Buttons ➪ Standard, then reselect As Excel treats the menu bar as just the button you want to replace. (This another toolbar, it’s possible to Alt- requires a bit of menu gymnastics!) drag an entire menu off the menu bar! If you do this, you will need to use aIf you accidentally remove an entire menu, use different method to replace the menu.this method to replace it:1. Select Tools ➪ Customize…2. Click on the Commands tab.3. Select Built-in Menus from the Categories list.4. Click on the missing menu in the Commands list, then drag it back into position in the menu bar.Note that you can use this method to add new commands to the menu bar if you wish.When you select Built-in Menus in the Categories list, all of Excel’s commands are organisedinto menus for you in the Commands list. Figure 1.8 shows a handy Clear menu added in thisway. Figure 1.8 A new Excel menuThis method can be used with Word too, of course, as the handling of toolbars is identicalto Excel’s.Adding document detailsExcel saves extra information with worksheets in the same way that Word does withdocuments—a worksheet’s title (not the same as its file name), subject, author, categoryand so on. This can be useful for several reasons:■ Microsoft Office applications have their own search tool that allows you to search for this information. This might allow you, for example, to find all workbooks by the same author quickly.■ You can define your own workbook properties. You might use this, for example, to track the progress of something like a financial report, using sequential version numbers.
  • 22. Shortcut keys 17Try this now with your shopping list workbook:1. Select File ➪ Properties. It’s quite likely that you’ll see something like Figure 1.9. Figure 1.9 Document properties2. Enter something like ‘Trial Excel shopping list’ in the Title field and click on OK.3. Re-save the document by selecting File ➪ Save.Shortcut keysAs an alternative to using the menu commands, Excel offers you shortcut keys. These arekey combinations, typically including a modifier key, that perform a specific function suchas selecting a menu command. See the table on the next page for the essential shortcut keysyou need to know in Excel.Getting help on ExcelIf you did not disable the Office Assistant when you worked throughthe steps on Word, all you have to do to get help in Excel is to clickon it, popping up a dialog into which you can type your question.If you disabled the Office Assistant, you can get the same results bytyping a question into the help field in the menu bar.
  • 23. 18 Step 1—Getting started with Excel Excel’s essential shortcut keys As you work with programs like Microsoft Excel, it’s a really good idea to try to become familiar with the shortcut keys, at least for commonly used commands. This is because it takes far less time and effort to type, say, Ctrl + V than to take your hands off the keyboard, reach for the mouse, go to the Edit menu, click and select Paste. We won’t slavishly give all the shortcut keys when we introduce a menu command, as this would clutter up the book, but as you work with Excel, try to become familiar with the shortcuts you find useful. Here are the absolute minimum that you need to know— and they work in all Office programs: ■ Ctrl + X Cut selection ■ Ctrl + C Copy selection ■ Ctrl + V Paste ■ Ctrl + Z Undo last command ■ Ctrl + Y Redo last command ■ Ctrl + S Save workbook (do this frequently!) ■ Ctrl + P Print worksheet ■ Ctrl + O Open a workbook ■ Ctrl + W Close current workbook Shortcut keys are displayed next to each menu command when the menu is displayed. You can also select Help ➪ Microsoft Excel Help to display a help window with more help options, including a table of contents and index for Excel’s help. Finally, most of Excel’sDone! dialogs also have contextual help, which you can access by clicking on the icon.
  • 24. Getting help on Excel 19ReviewIn this step, you learned:■ What spreadsheets are and what they are for.■ Excel refers to spreadsheets as worksheets, which are bound into workbooks.■ Excel has controls a little like those of Word.■ Excel has many toolbars, which are customisable in the same way as Word’s.■ You can zoom to enlarge any part of a worksheet.■ You can lock a row or column on screen so that it stays in view as the worksheet is scrolled.■ Worksheets are made up of cells.■ A cell can contain text, a numerical value or a formula (a calculation).■ Formulae can reference the contents of other cells.■ Worksheets can reference data in other worksheets.■ A cell containing a formula displays the formula’s total.■ Excel lets you add, delete, or copy worksheets, either within a workbook or between workbooks.■ Excel has comprehensive built-in help.■ Almost everything about Excel’s user interface can be changed.Quiz1. How is a cell defined in Excel?2. How do you tell Excel that the contents of a cell is a formula?3. Can a formula in a worksheet make use of data stored in another worksheet?4. What is the editing field used for in Excel?5. How many rows does an Excel worksheet have?6. How do Excel templates differ from workbooks?7. Suggest two uses for multiple worksheets within a workbook, and try and think up one of your own.8. How do you move a worksheet within a workbook? Try to do so.9. It’s possible to turn off Excel’s automatic recalculation. Why might you want to do this?10. Suggest a use for Excel’s document properties.
  • 25. Working with STEP spreadsheet data 2 Checklist ■ Entering data into Excel ■ Editing data in cells ■ Searching for and replacing data ■ Moving and copying data between cells and worksheets ■ Sorting dataT he last step introduced you to Excel’s basic user controls. Now it’s time to look in more detail at how Excel handles numerical and text data, and the features it offers you for working with data.How Excel interprets data entriesMany computer applications have been described as ‘intelligent’, but Excel is one that hassome claim to this title. It adopts the approach that a tool designed to work with numbersshould be good at understanding numbers. For example, Excel applies a formatautomatically to every number you enter, based on its best guess of what the number is.To see how this works, try the following short exercise:1. Open a blank workbook in Excel.2. Click in cell A1 to highlight it.3. Enter the following: 12 Return 12.25 Return
  • 26. 22 Step 2—Working with spreadsheet data 12e2 Return 12/12/04 ReturnYou should now see something like this:Can you see what Excel has done? Here’s a step-by-step description:1You entered What Excel did12 Excel interprets this as a number and determines that it does not require any special formatting. It applies its default format to the number, which is called ‘General’.12.25 Excel interprets this as a number, and applies its General format to display only as many decimal points as are required.12e2 Excel interprets this as a number in scientific notation1, and applies its ‘Scientific’ format automatically to display it as 1.20E3.12/12/04 Excel interprets this as a date, and formats it accordingly as 12/12/2004. It has also made the column a little wider to accommodate this format.Now do another short exercise:1. Click again in A1 to select it.2. Enter the following: 14 Return 14 Return 14 Return 14 Return 1. In scientific notation, numbers are expressed as a mantissa and an exponent. The mantissa con- tains the significant digits of the number in the range 0–9, and the exponent contains the power of ten to be applied to the mantissa. For example, 12.25 is ‘1.225E1’ in scientific notation, while 1001 is ‘1.001E3’. For numbers less than 1 a negative exponent is used, for example 0.0033 is written as ‘3.3E-3’. If this seems hard to understand, try mentally moving the decimal point in the mantissa by the number of places after the ‘E’ in the exponent, to the left if negative, and to the right if positive. Scientific notation provides a convenient way to handle very large or very small numbers.
  • 27. Editing cell data 23You should now see something like this:Here’s what’s happened:Cell contains Why?14 When you originally entered 12 in this cell, Excel interpreted it as a number and determined that it did not require any special formatting. The default format is General. This cell therefore still has the format General, so the data is displayed as ‘14’.14 As above, Excel interpreted your original entry, 12.25, as a number, and applied the General format. This cell therefore still has the format General, so the data is displayed as ‘14’.1.40E1 Excel interpreted your original entry, 12e2, as a number in scientific notation, and applied its Scientific format automatically. This cell there- fore still has Scientific format applied to it, so your entry of 14 is displayed as ‘1.40E1’.14/01/1900 Excel interpreted your original entry, 12/12/04, as a date, and so applied a date format to the cell. This format is still applied, so Excel interprets an entry of 14 as ‘the 14th day of the date format’. Excel’s dates start from 1st January 1900, so the cell displays ‘14th January 1900’.Excel has retained the formatting it applied automatically to these four cells. This may seemconfusing at first, but it allows Excel to process all numerical data internally in the mostefficient way, and display it in ways that make sense to us humans. We’ll return toformatting in more detail in Step 4.Editing cell dataJust as Excel tries to make it easy for you to insert data, it also tries to help with editingdata. In this section we’ll look at the ways you can move and copy data within and betweenworksheets, and at how you can create an automatic data series.
  • 28. 24 Step 2—Working with spreadsheet dataSelecting cells, columns and rowsBefore we look at how to edit, move and copy the data in cells, you need to know how toselect parts of a worksheet. Try these now on a blank worksheet:1. To select a single cell, either click in the cell or enter its reference in the cell selector (see Figure 1.2 on page 5).2. To select a range of cells, click in the first cell and drag to select all the required cells.3. To select a large range of cells, click in the first cell, hold down Shift and click in the last of the range of cells to be selected.4. To select a range of cells larger than that displayed in the worksheet’s window, click in the first cell, enter the cell reference of the last cell to be selected, then press Shift Return.5. To select an entire column, click on the column title.6. To select an entire row, click on the row number.7. To select non-adjacent cells, rows or columns, click on the first cell, row number or column title, then hold down Ctrl (Control) and click on the second cell, row number or column title.8. To select all cells in a worksheet, click on the Select All button at the top-left of the worksheet:Moving and copying data using draggingOnce you have selected a cell or group of cells in a worksheet, you can drag them whereveryou want in the worksheet. Try this:1. Open a new blank workbook in Excel if you need to.2. Enter three numbers in three cells of the same column, using Return to move between cells.3. Click in the first cell again and drag downwards to select all three cells. You should see something like this:
  • 29. Editing cell data 254. Release the mouse and move it over the boundary of the highlighted cells. The mouse cursor changes to a four-pointed arrow, like this: This is Excel telling you that you can click and drag the selected region anywhere on the worksheet. Try it.5. Now try the same thing with the Ctrl key held down. Now the cursor changes to a plus sign: This is Excel telling you that dragging now will create a copy of the selected cells. Try it.Moving and copying data using menu commandsExcel also has a pop-up menu that is displayedwhenever you right-click in a worksheet. Try this shortexercise to move or copy data:1. Using the same workbook you used in the previous exercise, select the three cells that contain numbers again.2. With the mouse cursor within the selected cells but not over their boundary, right-click to display the pop-up menu.3. Select Copy. Excel displays a flashing boundary on the selected cells to show that they have been copied to the clipboard. (To move the data instead, select Cut.)4. Position the mouse over a target cell, right-click again, and select Paste. Excel copies the selected cells to the new location. Note that the selected target cell is always used for the top-left cell of the copied group.
  • 30. 26 Step 2—Working with spreadsheet data After you have pasted the data, Excel displays a small clipboard icon, as shown: This allows you to select paste options—try clicking on it to see what’s offered. The Link Cells option places references to the copied cells into the destination cells, instead of the copied values. We’ll have a lot more to say about cell references later.Moving and copying non-adjacent dataTo carry out this exercise, you will need data in more than one column. Do this:1. Close your currently open workbook, if you have one open, discarding the data.2. Open a new blank workbook.3. Enter numbers in non-adjacent columns, as shown:4. Drag to select the first group of cells, then hold down Ctrl and drag to select the second group of cells:5. Right-click and select Copy (or Cut) from the pop-up menu.
  • 31. Editing cell data 276. Move the mouse cursor to your chosen destination for the copied cells, right-click and select Paste.Note that Excel pastes the contents of the copied cells in two adjacent columns, eventhough the original data was not in adjacent columns.Moving and copying data between worksheets and workbooksExcel does not restrict you to working on one worksheet or workbook—you can work withmultiple worksheets at a time, and can open as many workbooks as you wish. You can dothis in several ways:■ To work with more than one worksheet, click on the sheet selector widgets to toggle between worksheets.■ To open more than one workbook, do one of the following: – Click to select the first workbook you want to open, hold down the Ctrl key, click the second workbook, then right-click and select Open from the pop-up menu. – Click and drag to select more than one workbook, then right-click and select Open from the pop-up menu. – Double-click the first workbook to open it, display the folder window again by click- ing on its icon in the Windows taskbar, then double-click on the second document to open it.■ To work with more than one workbook, do any of the following: – Switch between workbooks by clicking on their icons in the taskbar. – Use the icon to minimise workbooks into the taskbar, then just click their icons in the taskbar as required. – Switch between workbooks using the Window menu.You can copy and paste or move data between worksheets and between open workbooks.Here’s how to copy or move data between worksheets.
  • 32. 28 Step 2—Working with spreadsheet data1. In the worksheet you already have open, click and drag to select some data.2. Right-click to display the pop-up menu, then select Copy if you want to copy data, or Cut if you want to move data.3. Click on the sheet selector for Sheet 2.4. Position the mouse where you want to paste the data, right-click and select Paste from the pop-up menu.Copying or moving data between two workbooks is just as easy. To do this, we’ll first haveto create a new workbook:1. Select File ➪ New and click on the Blank Workbook link in the task pane. Excel opens a new blank workbook in the same window.2. Select Window ➪ Book1 to return to the original workbook.3. Click and drag to select some data.4. Right-click to display the pop-up menu, then select Copy if you want to copy data, or Cut if you want to move data.5. Select Window ➪ Book2 to display the second workbook.6. Position the mouse where you want to paste the data, right-click and select Paste from the pop-up menu.Try the two exercises above a few times on your own, perhaps this time using the menucommands instead. When you have finished practising moving and copying data, close bothworkbooks and discard the changes.How Excel handles cell references when cells are copied or movedThe exercises above are all very well, but all we are moving is numbers. The power of Excelcomes from the fact that cells can contain formulae that reference the contents of othercells.You may be wondering what happens to such cell references when the cell containing aformula is moved or copied. The answer is that Excel does what you normally want it to—
  • 33. Editing cell data 29it adjusts the cell references relative to the move or copy. If this doesn’t make much sense,try the following simple exercise:1. Open a new blank workbook. Note2. Click in cell A1 to select it.3. Enter 12 Tab =A1. In step 3, note that the contents of B1 is the expression =A1, not 12. Cell B1 This places the numerical value 12 in A1, displays the value 12 because this is and the expression =A1 in B1. This just tells the result of the expression =A1. This Excel always to make the value displayed in may seem confusing until you become B1 equal to the value contained in A1. Cell more familiar with Excel. B1 is now said to be dependent on A1. At this stage the worksheet should look like this: —which is not very exciting.4. Now drag to select the first two rows and use the pop-up menu to copy them somewhere else in the worksheet, as you learned how to do in Moving and copying data using menu commands on page 25.5. Your worksheet should now look something like this: Now click in the right-hand cell of the pair you have copied, C5 in this picture. What does it contain? Can you see what Excel’s done?When you move or copy dependent cells, any references to other cells in formulae arechanged automatically by Excel to reference the same relative cells after the move or copyoperation. This is normally what you want to happen. If it’s not, you can prevent it—we’llgo into more detail about this in Step 3.
  • 34. 30 Step 2—Working with spreadsheet dataEditing data in cellsAs you have seen, you insert data in cells by clicking in the cell and typing the data. To editdata already in a cell, click to select the cell and then edit the cell’s contents in the formulabar.When you click in the formula bar, Excel highlights any cells that are referenced by aformula in the cell being edited, using colour to distinguish them, as the illustration aboveshows (or would, if it were in colour). When you have made any changes you wish, thebutton allows you to accept your changes, and the button to reject them.However, Excel is cleverer than this. While you are editing the cell contents, you can clickon and drag any of the highlighted referenced cells. You do this by moving the mouse cursorover the edge of the highlighted cell you want to move, then click and drag it to the newlocation. Excel then adjusts the formula accordinglyPractise this now, using some simple formula such as the one shown in the illustration above.Adding comments to cellsYou can add comments to individual cells. Comments are useful, for example to explain aformula, either for a colleague, or to remind yourself at a later date.
  • 35. Editing cell data 31To enter a comment in a cell, select the cell, then select Insert ➪ Comment. Excel opens awindow for your comment, titled with your name:To close the comment window, just click outside it. After you have done so, Excel shows asmall red tag at the top-right corner of the commented cell. Moving the mouse pointer overthe cell causes the comment to be displayed:To change or delete the comment, select the commented cell, right-click and select EditComment or Delete Comment . The Show Comment option causes the comment to bepermanently displayed until the corresponding Hide Comment command is selected for thecell.Clearing or deleting cellsTo clear the contents of one or a group of cells quickly, drag to select them, right-click andselect Clear Contents from the pop-up menu. This clears everything from the cell or cells:contents, formats and comments. You have more control if you select Edit ➪ Clear, as thereare options for clearing the contents and the formatting of the cell separately.To delete a single cell, right click with the cell selected and chooseDelete… from the pop-up menu. Excel prompts you with the dialogshown. Here’s a short exercise to demonstrate how the options work:1. Close your current workbook, if you have one open, discarding the changes.2. Open a new blank workbook.3. Enter numbers in the first few rows, as shown below:
  • 36. 32 Step 2—Working with spreadsheet data4. Click to select cell B4.5. Right-click and select Delete… from the pop-up menu. In the dialog, select Shift cells up. Click on OK.6. Now select Edit ➪ Undo and repeat step 5, this time selecting Shift cells left.7. Finally, select Edit ➪ Undo and repeat step 5, this time selecting Entire row.This exercise should give you an idea of what you can do. In your own time, try thecorresponding commands from the Insert… option on the pop-up menu. When you’vefinished, keep the workbook open, as we’ll use it in the next exercise.Inserting and deleting cells, rows and columnsUsing the workbook you were using in the previous exercise, try this:1. Click on the title of column C to select the entire column.2. Select Insert ➪ Columns. This command inserts as many columns as are currently selected to the left of the current selection, moving the remaining columns to the right.3. Now select Edit ➪ Undo and click on the titles of columns C, D and E to select them.4. Select Insert ➪ Columns. This time, because you had three columns selected, Excel has inserted three new blank columns.5. Now select Edit ➪ Undo and click on the title of row 4 to select it.6. Select Insert ➪ Rows.As you can see, Excel works the same way when inserting rows as when inserting columns.Undoing changesJust as with Word, Excel has two matching commands, Undo and Redo. You can find themin three different ways:■ From the Edit menu.■ Using the and icons on the Standard Toolbar. These have pop-up menus that allow you to undo or redo more than one command at a time. (If you have the Standard and Formatting toolbars displayed on the same row, the button is obscured.)■ Using the shortcut keys Ctrl + Z (Undo) and Ctrl + Y (Redo).Excel saves all the changes you make in an editing session, and you can undo all of them atany time.
  • 37. Editing cell data 33Creating automatic seriesThe final editing technique you need to know about in Excel is referred to as auto-fill. Exceloffers this for use with adjacent cells to provide you with a very simple way of constructingseries of numerical values—whether they are numbers or dates. Try the following shortexercise:1. Close your current workbook, if you have one open, discarding the changes.2. Open a new blank workbook.3. Click in cell A1 to select it.4. Enter 1 Return 2.5. Now drag to select the first two rows.6. Move the mouse cursor over the auto-fill handle—this is the dark square at the lower- right of the highlighted cells. The mouse cursor changes to a + sign:7. Click and drag downwards for ten or so cells. You should now see something like this: Excel has looked at the two cells you copied, and found that they consisted of a numer- ical series with an increment of 1. It has therefore continued the series in the destina- tion cells. The icon to the lower-right of the destination cells contains a set of auto-fill options. Click in it to see what’s there. The option Fill Series is the one that Excel has just performed for you.As a further exercise, repeat step 7 with the Tipvalues:■ 0 and 10 Auto-fill works in the same way if you drag to fill rows rather than columns.■ ‘Mon’ and ‘Tue’■ 12/12/06 and 13/12/06
  • 38. 34 Step 2—Working with spreadsheet dataLook at the auto-fill options after you have created the series of days and dates. Are theydifferent?Searching for data, replacing dataExcel has a powerful Find command, just as Microsoft Word does. Excel’s Find commandallows you to search for numerical values, text, formula results or text in comments.Searching for dataTo demonstrate Excel’s Find command, you need to create a simple worksheet with someuseful contents:1. Close your current workbook, if you have one open, discarding the changes.2. Open a new blank workbook.3. Click on cell B3 to select it, then enter the following data exactly as shown: 12 Tab =12 Tab This cell contains 12 Return =12+14 Tab 12 Return Don’t miss the apostrophe from the last number.4. Click in cell D4 and select Insert ➪ Comment. Enter 12 in the comment window, then click outside the window to close it. This populates the worksheet as follows: Cell Contents B3 The numerical value 12 C3 A formula containing only the number 12 D3 A text string containing ‘12’ as characters B4 A formula containing the value 12 C4 ‘12’ as characters (the leading apostrophe tells Excel to treat the entry as characters rather than as a number) D4 A comment containing ‘12’ as characters5. Click in cell A1 to select it, then select Edit ➪ Find… Excel displays the Find and Replace dialog, as shown in Figure 2.1.
  • 39. Searching for data, replacing data 35 Figure 2.1 Excel’s Find and Replace dialog6. Enter 12 in the Find what field, then click on Find Next. Excel advances the cursor to cell B3, and the formula bar displays its contents.7. Click again on Find next. Excel finds the formula result of 12 in cell C3.8. Repeat step 7 to find the characters ‘12’ in the text contained in cell D3.9. Repeat step 7 to find the numerical value 12 in the formula in cell B4.10. Repeat step 7 to find the character ‘12’ in cell C4.11. Click on Find next again. Note that the ‘12’ in the comment in cell D4 is not found. This is because by default Excel does not search in comments.12. In the Find and Replace dialog, click on Options>>. Excel expands the dialog, as in Figure 2.2. Note the options for controlling the search order by columns or by rows, and for widening a search to the whole workbook. Figure 2.2 Excel’s expanded Find and Replace dialog13. Use the widget next to the Look in field to select Comments, then click on Find next. Excel now finds the characters ‘12’ in the comment in cell D4—even though the comment is not displayed.14. Use the widget next to the Look in field to select Formulas, then click on Options <<. This sets the find command back to its default.15. Finally, click on Find All. The Find and Replace dialog expands to show a list of all the cells that contain ‘12’, as Figure 2.3 shows.
  • 40. 36 Step 2—Working with spreadsheet data Figure 2.3 Excel’s Find All feature in actionIf you click in the list of found items, Excel selected the relevant cell.Keep this workbook open, as we will use it in the next section.Using the replace commandAs you might imagine, replacing using the Find and Replace dialog is hardly more difficultthan using it to find data.1. Close the Find and Replace dialog, if you left it open at the end of the last exercise.2. Click in cell A1 to selected it, then select Edit ➪ Replace… Excel displays the Find and Replace dialog with the Replace pane selected.3. Enter 12 in the Find what field, and 14 in the Replace with field.4. Click on Find next. Excel advances to cell B3, the first occurrence of 12.5. Click on Replace.6. Continue to do this, watching the formula bar, as you click on Replace four more times.Do you notice anything interesting? Although each of the five occurrences of the number12 has a different context, as the table on page 34 shows, Excel is clever enough to replaceit with 14 in the correct context for each occurrence.You can discard this workbook now, as we have finished with it.Sorting dataSorting numerical values is often useful, mainly because it makes lists of items easier forhumans to understand. For example, if you are using Excel to display tables of values, youcan use it to sort the tables into ascending or descending order.
  • 41. Sorting data 37Excel offers you two ways to sort data:■ A quick method using the sort buttons. This works for single columns of data only.■ Using the Sort dialog. This gives you complete control over simple and complex sorts.First we’ll try a simple sort:1. Close your current workbook, if you have one open, discarding the changes.2. Open a new blank workbook.3. Click to select cell B3. (Why not A1? Just because it’s a bit easier to see what’s going on if you’re not working against the row and column headers all the time.)4. Enter the following data: 12 Return 1 Return 24 Return 23 Return 15 Return5. Click to select any of the cells that have numerical contents.6. Click on the sort button in the Standard toolbar. Excel sorts the column of numbers in ascending value.7. The button produces a sort in descending order. Try it now.Note that Excel is clever enough to work out Notewhich set of numerical values you want to sort—you don’t usually have to select all the cells to be You can only sort data by one or moresorted explicitly. columns—you cannot sort data by rows.Now for more complex sorts, using two columnsof data:1. Close your current workbook, if you have one open, discarding the changes.2. Open a new blank workbook.3. Click to select cell B3.4. Enter the following data: Peter Tab 2500 Return Mary Tab 1233 Return Joe Tab 4500 Return Mike Tab 3422 Return Al Tab 5600 You can think of this as maybe monthly revenue per salesperson, or something relevant like that.5. Click in cell B5 (or any cell containing data in column B).6. Click on the sort button in the Standard toolbar. Excel sorts the two columns of data, using the first column to determine the sort order (alphabetical).7. Select Edit ➪ Undo to remove the sort, then click in cell C5 (or any cell in column C that contains data).
  • 42. 38 Step 2—Working with spreadsheet data8. Click on the sort button in the Standard toolbar. Excel sorts the two columns of data, using the second column to determine the sort order (numerical).9. Select Edit ➪ Undo to remove the sort again, then click and drag to select cells B3 to B7.10. Click on the sort button in the Standard toolbar. Excel displays a warning dialog, as shown in Figure 2.4. This is because it senses that you are trying to sort only part of a data set, which would produce invalid results. Figure 2.4 Excel’s Sort Warning dialog11. Click on Cancel, but keep the worksheet open for the next exercise.Finally, we’ll show you how to set up a sort of multiple columns:1. Drag to select the range of cells B3 to C7.2. Select Data ➪ Sort… Excel displays the Sort dialog, as shown in Figure 2.5. Figure 2.5 Excel’s Sort dialog3. Click on the widget next to the Sort by field. Note that Excel is offering to sort by the first column or the second column. If there were more columns of data in your selection, you would have an option for each column. This dialog allows you to select a secondary sort by using the Then by field. This will only have an effect if you have more than one item in the first sort column that has the same sort order (in our case, for example, two rows for Mike).
  • 43. Sorting data 39 4. Click on OK to perform the sort. You’ve now used both types of sort that Excel offers. Finally, as exercises: ■ Insert some extra rows to extend your data set with several entries for each person, then use the Sort dialog to perform a sort using the Then by field to establish the secondary sort order. ■ Use cells B2 and C2 to add the headings ‘Salesperson’ and ‘Order Value’. Use the Sort dialog again, selecting these headings also, but clicking in Header row to tell Excel thatDone! it must exclude the header rows from the sort.
  • 44. 40 Step 2—Working with spreadsheet dataReviewIn this step, you learned that:■ You can select ranges of cells, whole rows and columns, and non-adjacent selections.■ You can move data between cells using dragging.■ You can copy and paste data between cells.■ You can use several methods to edit data in cells, including the formula bar.■ You can easily delete data from a group of cells.■ Excel edits relative cell references when cell contents are copied or moved.■ Excel has a multi-level undo command.■ You can insert or delete whole rows and columns.■ Excel can create a series of consecutive data items automatically.■ You can add comments to a cell.■ Excel has tools that allow you to search for data and replace it.■ Excel allows you to do simple and complex sorts.Quiz1. What is the purpose of a cell format in Excel?2. How could you copy the contents of column B and column D at the same time?3. How would you copy a block of cells from one worksheet to another within the same workbook?4. What happens to cell references when you move or copy a formula?5. How does Excel use colour to make editing formulae easier? Try it to remind yourself.6. If you entered 1/3/05 in a cell, selected the cell and duplicated it by dragging, what would the new cell contain? Why?7. By default, a search in Excel finds all the different kinds of data you can put in a cell with one exception. What is the exception?8. We sometimes refer to complex sorts using the terms major and minor sort, or primary and secondary sort. What feature in Excel’s Sort dialog allows you to set up a minor sort?
  • 45. Using spreadsheet STEP formulae 3 Checklist ■ Using functions in Excel ■ Creating formulae ■ How Excel processes formulae ■ Relative and absolute cell references ■ Mixed cell references ■ Excel error messages ■ Conditional functions—making decisionsY ou have now covered the basics of Excel: the user controls, creating and saving workbooks, and entering and editing data. The power of Excel, however, comes from its ability to calculate the results of formulae, display them in cells, and usethose results in other formulae. This is what we will concentrate on in this step.Using Excel formulaeYou have already learned that a cell whose contents start with ‘=’ is interpreted by Excel asa formula. Excel will try to calculate the results of any formula it finds and displays theresults in the cell. But how can you create formulae? Excel offers you four ways:■ Entering a formulae directly into a cell.■ Entering a formula using the formula bar.■ Building up formula by clicking on the cells you wish to include.■ Pasting Excel functions into a formula.We will describe these in the sections that follow.
  • 46. 42 Step 3—Using spreadsheet formulaeExcel functionsExcel functions provide the real mathematical power of Excel. A function in Excel is anexpression that calls a piece of code dedicated to a specific purpose. For example, theformula: =SUM(A1:A4)calls the function SUM() to return the total of the cells A1, A2, A3 and A4, that is: A1+A2+A3+A4Excel contains over two hundred functions, which allow you to calculate results that wouldbe far too complex and tedious to program into a worksheet by hand. You can see this if youselect Insert ➪ Function… in a blank worksheet, then set Or select a category in the InsertFunction dialog to All. Many of them you will never use, as they are dedicated to complexmathematical calculations that you are unlikely to encounter—at least, not yet. Some, suchas the SUM() function described above, are essential.Excel’s functions are grouped by purpose, as the pop-up menu adjacent to the Or select acategory field in the Insert Function dialog shows. Most of the categories are self-explanatory:Category IncludesDatabase A set of functions for calculating data from an embedded database, or ‘look up’ list. Excel allows tables of data to be embedded in a worksheet, as we mentioned in Working with worksheets on page 10.Date and Time Functions to convert or display anything to do with dates, hours, minutes and seconds, for example NOW(), which returns the current data and time.Financial A set of functions to calculate common financial values, such as the total cost of a loan, the future value of an investment, or the required interest rate for a loan.Information A set of functions that are mainly concerned with returning infor- mation about the state of other cells. For example ISBLANK(), which returns FALSE if a cell or range of cells has contents, else TRUE.
  • 47. Using Excel formulae 43Category IncludesLogical A set of functions for combining logical expressions, such as AND(), OR(), IF(), and which return the values TRUE or FALSE.Lookup and A set of functions for extracting data from look-up tables withinReference a worksheet, or information about the current cell. Examples of the latter are ROW() and COLUMN(), which return the row and column numbers of the cell containing the current formula (i.e. “What row or column am I in?”).Maths and Trig A set of functions to calculate common mathematical and trigo- nometrical values, such as sine, tangent, cosine, square root, sum of squares.Statistical A comprehensive set of functions to calculate values used in statistical analysis, such as average, maximum, minimum or n-th largest of a set of numbers, as well as more complex functions such as the χ -squared, Poisson distribution and Student’s t-distri- bution tests.Text A set of functions to process text, for example to make one length of text from text in multiple cells, to convert numbers to text, or to convert text to upper or lower case.We will demonstrate some of the more common functions in the examples in the sectionsthat follow.Creating formulaeFirst we’ll repeat the simple exercise we first did on page 3, but with some changes toillustrate the different ways to enter formulae in Excel:1. Open a new blank workbook.2. Click in cell B3 to select it.3. Enter Eggs Tab 1.25, then press Return. Notice that the cell below your starting cell is now highlighted. This is because Excel has decided—because you pressed Return—that you are probably entering a list of items.4. Enter: Flour Tab 1.1 Return Potatoes Tab 0.85 Return Meat Tab 2.26.
  • 48. 44 Step 3—Using spreadsheet formulae Here’s what things should look like now.5. Click in the cell two below Meat and type Total Tab.6. Click in the formula bar and type ‘=’7. Now click in cell C3. Note that Excel has entered ‘C3’ in the formula bar.8. Enter ‘+’ and then click in cell C4.9. Repeat this to build up the following formula: =C3+C4+C5+C6 Here we are, of course, adding the contents of the cells. We could just as easily use any of Excel’s other mathematical operators: + Add - Subtract * Multiply / Divide10. Press Return. Excel closes your editing session in the formula bar, calculates the total of the formula and displays it in cell C8.Now we’ll edit the total to use the SUM() function. We can still select cells by clicking,though:1. Click in cell C8 to select it.2. In the formula bar, drag to select C3+C4+C5+C6.3. Select Insert ➪ Function…4. In the Insert Function dialog, enter sum in the Search for a function field, then press Return. Excel will select the SUM() function.5. Click on OK. Excel displays the Function Arguments dialog. If all is well, it will select the range of cells C3:C7 for you, as Figure 3.1 shows. Note that Excel has already calculated the result of the SUM() function and displayed it in the dialog. The button adjacent to the Number fields allows you to select a range of cells by click-
  • 49. Using Excel formulae 45 Figure 3.1 Function Arguments dialog for SUM() ing and dragging. Try it now to see how it works.6. When you have finished experimenting, click on OK to close the Function Arguments dialog.Entering a function like this might seem a bit long-winded for something as simple asSUM(), but it’s really useful for functions with more, or more complex, arguments, or forfunctions with which you’re not familiar.Keep this workbook open for the moment, as we’ll add to it in the next step.Some more functionsNext we’ll add a few more useful functions to our shopping list to show the cheapest andmost expensive items, and the number of items in the list:1. In the worksheet you used in the previous section, select cell B10 and enter: Costliest Tab =MAX(C3:C6) Return Note that as soon as you enter the ‘(’ for the function MAX(), Excel prompts you with the correct syntax for the function.2. As you can see, the MAX() function displays the highest value from a range of cells. Now enter: Cheapest Tab =MIN(C3:C6) Return3. You can see from this what the MIN() function does. Now enter: No. of items Tab =COUNT(C3:C6) Return The COUNT() function returns the number of cells from the specified range that contain numbers. It ignores cells that contain text or logical values.4. In row 13, enter: Average cost Tab =AVERAGE(C3:C6) Return The AVERAGE() function returns the number that is the average of the contents of
  • 50. 46 Step 3—Using spreadsheet formulae the cells in the specified range. As these cells contain the values 1.25, 1.1, 0.85 and 2.26 in our example, the average returned will be: (1.25 + 1.1 + 0.85 + 2.26)/4 which is 1.365.5. Save and close the workbook, as we’ll use it again later.The order of processing of formulaeWhen you write formulae in Excel, you need to remember that it has a predefined order ofpriority for processing mathematical expressions. What we mean is that: =3+4*12in Excel give the answer 51—that is, Excel gives the multiplication a higher priority than theaddition, so does it first. So this expression is equivalent to: =3+(4*12)and not: =(3+4)*12which would give the answer 84. Excel uses the following order of priority when executingformulae:Priority Operator DescriptionHighest Colon, comma Cell references, for example ‘C3:C6’ - Negation, for example ‘-1’ % Percentage, for example ‘20%’ ^ Exponentiation, for example ‘2^3’ (this means ‘2 cubed’, i.e. 2*2*2) * and / Multiplication and division + and - Addition and subtraction & Join text strings (‘concatenation’)Lowest = < > <= >= <> Comparison: equal, less than, greater than, less than or equal, greater than or equal, not equal
  • 51. Using relative and absolute cell references 47You can override this order of priority by using brackets. Excel will first evaluate theexpression in the innermost pair of brackets, using the priority shown above, then the nextpair of brackets, and so on. If it finds two mathematical operators with the same priority,such as multiplication and division, it evaluates the formula from left to right.Using relative and absolute cell referencesYou have seen how a formula in Excel can refer to the contents of other cells. You also sawin the previous step how Excel helpfully edits cell references when you copy or moveformulae (refer back to How Excel handles cell references when cells are copied or moved onpage 28 if you need to). These references are written in the form: cell row:cell rowFor example: C3:C5Suppose however that you don’t want Excel to do this. Consider the case in which a cellcontains a number that you always want Excel to use, no matter how formulae thatreference it are copied or moved. Such a value might be something like a currencyconversion, or any fixed value you want to use in other calculations.To demonstrate this, we’re going to extend our shopping list so that it displays prices in bothpounds sterling and euros:1. Reopen your shopping list workbook, if it’s not still open from the previous section.2. First, add the titles ‘Item’, ‘Pounds’ and ‘Euros’ in cells B2 to D2.3. Drag to select these cells again, then click on the button in the formatting toolbar to set the titles to bold.4. In cell F2, enter: Euros per Pound Tab 1.52118 Return (or substitute the current conversion rate)5. You can probably only see part of what you typed, as column F will be too narrow to display the entire phrase. Move the mouse cursor over the boundary between the titles for columns F and G, then click and drag to make column F wide enough.
  • 52. 48 Step 3—Using spreadsheet formulae Your worksheet should now look something like this:6. Click in cell D3 and enter the following: =C3*G2 Return This calculates the price of your eggs in Euros, and the result is displayed, which will be €1.901475 if you used the exchange rate of €1.52118/£1.7. Now click again in cell D3, and using the technique you learned in Moving and copying data using dragging on page 24, drag to copy its contents to cells D4 to D6. Not quite what you expected, maybe? As you can see if you select cells D4, D5 or D6, Excel has changed the reference to cell G2, which contains your conversion rate, to G3, G4 and G5. However, this is not what you want to happen—you want Excel to use the contents of cell G2 for all the conversions. Here’s how to stop this happening…8. Select cell D3 again. Using the formula bar, change the cell’s contents to: =C3*$G$2 This form of cell reference, ‘$G$2’, is known as an absolute reference. The ‘$’ signs tell Excel never to change the cell reference, no matter how often it is moved or copied— it will always reference cell G2.9. Repeat step 7. This time you should get correct results in euros for all your items.10. To complete this exercise, we’ll visit the formatting dialog to set the decimal spaces of the euro figures to 2. Select cells D3 to D6, then select Format ➪ Cells… In the Format Cells dialog, select Number. The number of decimal places should default to 2, so just click on OK.We’ll have more to say about cell formatting in Step 4. Before you leave this step, try thefollowing exercises on your own:■ Copy cells C8 to D8 and C10:C11 to D10:D11 to see how Excel handles absolute function references.■ Change the euro conversion rate by changing the value in G2 and watch Excel work for you!
  • 53. Using mixed cell references 49You can use the ‘$’ notation to make either the Tipcolumn, the row, or both, references absolute.For example, a cell reference of ‘$G2’ would When you are editing a formula in theensure that Excel never changed the column, but formula bar, the F4 key allows you tocould change the row, when such a reference was toggle between all the combinationsmoved or copied. of absolute, row-absolute, column- absolute and relative references. ExcelWhen you have finished, save your worksheet for is usually clever enough to work outlater. which reference to change.Using mixed cell referencesWe have described how you express a range of cells in Excel. For example, the formula: =SUM(A1:A4)is the same as =SUM(A1,A2,A3,A4)You might wonder how you express multiple ranges. For example, suppose you wanted totell Excel to calculate the sum of cells A1 through A4 and D2 through D6? It’s easy—youdo it like this: =SUM(A1:A4, D2:D6)Try this now for yourself, using a blank Tipworksheet to experiment with. You can selectnon-adjacent ranges of cells such as this by: You can ‘nest’ Excel functions. For■ Clicking and dragging to make the first example: selection =SUM(A1:A12,SUM(B1:B12))■ Holding down the Ctrl key means the same as:■ Clicking and dragging to make the second =SUM(A1:A12)+SUM(B1:B12) selection.Understanding Excel error messagesFrom time to time—although hopefully not too often—Excel will display an error messagein a cell instead of the answer you expect. This is fairly common when working withformulae. For example, if you enter something like: =C2*D2in cell E2, but cell C2 contains text, Excel will display #VALUE! in E2. This is Excel’s wayof telling you that it can’t make sense of what you are trying to do (you can’t multiply text!).
  • 54. 50 Step 3—Using spreadsheet formulaeExcel can display a wide variety of error messages. Those you are most likely to encounterare:Message Meaning##### Excel cannot display the cell’s contents, usually because the column is too narrow for the format selected.#VALUE! Excel cannot calculate a formula, usually because one or more of the values for the formula is of the wrong type.#DIV/0! You are trying to divide by zero. This is mathematically impossible.#NAME? Excel cannot recognise a cell range or the name of a function. This is sometimes caused by omitting a closing quote from text.#REF! Invalid cell reference, for example if you have deleted a cell that is referred to in a formula.#NUM! A function has the wrong type of argument.Using conditional functionsClearly we don’t have room, and you don’t have time, to learn about all the functions thatExcel offers. You need to know about the sum, average, minimum, maximum and countfunctions as a minimum, which we’ve already looked at.However, it also requires to have some idea about logical functions such as IF(). By logical,we mean functions that compare one or more items and produce a result of TRUE orFALSE. For example, here is a conditional test: A3>A4which means ‘the contents of cell A3 is greater than the contents of cell A4’. Obviously, thiscan only either be true or false. IF() allows you to include a test like this in a formula. Itreturns one of two values in a cell depending on the conditional test. For example: =IF(condition,Value if true,Value if false)The value returned by the function can be of any type that Excel supports. For example, itmight be text: =IF(A3>A4, "Above", "Equal or below")
  • 55. Using conditional functions 51To see this in action, we’ll add a column to our shopping list that compares each item to theaverage cost that you added in the exercises on page 48:1. Reopen your shopping list worksheet.2. If you had difficulties adding the average cost values in the exercises on page 48, carry out step 3 below, otherwise continue from step 4.3. Select cell B13, then enter: Average cost Tab =AVERAGE(C3:C6) Tab =AVERAGE(D3:D6) Return4. We want to add a new column for our Note conditional test values, so click on the column title of column E, then select Insert If a cell that is the destination of an ➪ Columns. Excel adds a new blank column absolute reference is itself moved as a for you. result of editing, Excel updates all the Notice that your euro/£ conversion rate is absolute references to the cell to keep now in cell G2 and not cell F2. However, it correct. This is usually precisely what your amounts in euros are still correct! If you want it to do. you look in any of the cells D3 to D6, you’ll see that the absolute reference to G2 has changed to F2.5. Select cell E2 and enter: Above average? Return6. Click and drag the column divider between column E and column F to make column E wide enough to display the whole title.7. Select cell E3 and enter: =IF(C3>$C$13,"Yes","No") Return You can type this is as written, or click the relevant cells to build up the formula. as you prefer. Remember that you can use the F4 key to make the reference to cell C13 absolute.8. Click in cell E3 again to select it, then copy it by dragging to cells E4 to E6.This is what your worksheet should look like now:
  • 56. 52 Step 3—Using spreadsheet formulae Save the changes to your shopping list worksheet at this point. After you have done so, experiment with changing the amounts in the Pounds column, and see how it changes the average item cost, and therefore the results in the Above average? column. I hope you can see from this how you can use the IF() expression to display information based on a logical comparison. The results of the function can just as easily be numerical. You could therefore use an IF() expression to display one of two numbers in a cell based on some logical comparison, and those numbers themselves could be used in a further formula. Complex relationships can be built up in this way. For example: Cells A1:A4 contain numerical data Cell B4 contains =IF(SUM(A1:A4)<12,1,2) Cell C4 contains =SUM(A1:A4)*B4 With these formulae, cell B4 will contain the value ‘1’ if the sum of cells A1 to A4 is less than 12, otherwise it will contain ‘2’. Cell C4 therefore multiplies the sum of A1 through A4 by 1 if their sum is less than 12, otherwise by 2. Although this is an abstract example, this sort of calculation is common in the world of finance and elsewhere. One example is the case of ‘tiered’ interest rates on a savings account, in which the interest rate paid depends on whether the balance of the account exceeds specific thresholds. For example: Balance Interest rate < £1,000 3.75% £1,000–£9,999.99 4.0% £10,000–£99,999.99 4.25% Without an IF() function, it would be difficult or impossible to model this type ofDone! calculation in a spreadsheet.
  • 57. Using conditional functions 53ReviewIn this step, you learned:■ You can enter a formula directly into a cell.■ You can add relative cell references to a formula by clicking on cells.■ Excel has a command that allows you to paste a function into a formula.■ You can edit formulae using the formula bar.■ What Excel functions are and how they work.■ That over 200 functions are available in Excel, many for special purposes.■ How to use the basic mathematical operators in formulae.■ You can use the Function Arguments dialog to select the arguments for a function.■ The order in which Excel evaluates formulae.■ The difference between relative and absolute cell references, and their purposes.■ How Excel expresses error conditions.■ What conditional functions are, and what they are for.Quiz1. What is the purpose of Excel functions?2. What is the main difference between a mathematical and a logical function?3. What does the COUNT() function do?4. Unless you tell it not to, Excel does addition before multiplication: true or false?5. How would you tell it not to?6. If cell A1 contained =B1*C$1, and you copied it to cell A2, which would cell A2 then contain? Why?7. If you then copy it to cell C7, what will C7 contain? Why? (If you’re not sure of the answers here, try it on a blank worksheet, then go back to Using relative and absolute cell references on page 47 and revise it.)8. What does it mean if a cell contains =AVERAGE(A1:A12,C1:C12)?9. What should you do if your formula displays #VALUE!10. What does the function =IF(MAX(A1:A6)>MAX(B1:B6),”Red”,”Blue”) do?
  • 58. Improving a STEP sheet’s appearance 4 Checklist ■ Choosing and using cell data display formats ■ Defining your own display formats ■ Setting text formats and options ■ Using borders to create forms within worksheets ■ Concealing data from display ■ Protecting formulae from accidental changeT his step is about presentation. Although you’ve constructed a working spreadsheet with your shopping list example that (almost!) does something useful, it’s a long way short of what Excel is capable of. In this step we’re going to look at Excel’sfeatures for formatting numbers and text, highlighting and hiding information, preventingthe contents of a worksheet from accidental change, and generally making your worksheetlook beautiful. At the end of the step, your simple shopping list will have become a fullyformatted interactive form.Setting display formats for dataExcel supports a huge range of display formats for numerical data, and if they are notsufficient, you can define your own. You saw how these work in How Excel interprets dataentries on page 21. When you enter numerical data in a cell, Excel examines it, makes anintelligent guess at what sort of number it is, and applies the appropriate formatting to thenumber.
  • 59. 56 Step 4—Improving a sheet’s appearanceHowever, this might not be what you want in all cases. If you remember from Using relativeand absolute cell references on page 47, when you first added your column of prices in euros,they looked something like this:Although we set the decimal places of the Euro column to 2 in that exercise, wouldn’t itlook better if the figures were given the correct currency symbol automatically? Here’s howto do it:1. Reopen your shopping list workbook if you need to.2. Select the first cell in the Pounds column.3. Select Format ➪ Cells… Tip4. Excel displays the Format Cells dialog. The dialog contains tabs for Number, The shortcut key for Format ➪ Cells… Alignment, Font, Border, Patterns and is Ctrl-1, and it’s one that is worth Protection. We’ll be visiting and using all of remembering, as you’re likely to use these later in this step. the formatting dialog frequently.5. Click in the Category column to select Currency, then select £ in the Symbol field, 2 in the Decimal places field, and select the first format under Negative numbers (we’re not interested in negative numbers here). Click on OK.6. Right-click on the selected cell, C3, which should now display £1.25, and choose Copy. Click and drag to select cells C4 to C6.7. You don’t want to paste the cell’s contents, just its format. To do this, select Edit ➪ Paste Special… Excel displays the Paste Special dialog, shown in Figure 4.1. As you can see, this gives you huge control over what you can paste, allowing you to copy any attribute or contents between cells. Here we just want to copy the format, so click in Formats and then on OK.8. We’ll apply the euro formats in one step. Click and drag to select cells D3 to D6. Select Format ➪ Cells…9. This time, select Currency and the € symbol. You will find that there is a huge range of euro settings for different European countries. These use the appropriate local conven-
  • 60. Setting display formats for data 57 Figure 4.1 Excel’s Paste Special dialog tion for putting the currency symbol before or after the number, as appropriate. Select the setting € English (Ireland) . Click on OK.Your worksheet should now look like this:What have we forgotten? We need to add Tipcurrency formatting to the maximum, minimumand average values. Do this now using the Edit ➪ Copy C3:D3, click and drag to selectPaste Special… command. You can copy and C8:D11, then Ctrl drag to includepaste the formats of both currencies with only C13:D13. Finally paste formats usingthree operations—try it yourself first before Edit ➪ Paste Special…reading the hint next.When you have finished, save your shopping list workbook, as we’ll be using it again later.Other useful number formatsExcel has many other numerical formats that are useful in specific situations. Before wemove on to formatting text, this section details some of the more common ones.
  • 61. 58 Step 4—Improving a sheet’s appearanceUsing number separatorsIf you are displaying large numbers, but scientific format is inappropriate, you can tell Excelto include number separators, so that one million, for example, is displayed as: 1,000,000Try this:1. Open a blank workbook.2. Enter a large number in any cell.3. Select the cell.4. Select Format ➪ Cells… and click on Number in the Category menu.5. Set the Decimal places value to 0, then click in Use 1000 Separator to enable it.6. Finally, click on OK.Formatting and using datesWhen you enter a number that Excel recognises as a date, it assigns a default format that isbased on the settings in Window’s Regional and Language Options control panel. Forexample, if this is set to English (United Kingdom) , entering: 1/1/5in a cell causes Excel to format it and treat it as: 01/01/2005that is, the 1st January 2005. Similarly, if you enter: 1-1-5the same thing will occur. Or if you enter: 1-jan-5Excel will interpret the date in the same way, but apply a different format: 01-Jan-05It’s important to know that Excel handles all time and date variables in an identical wayinternally. This is to allow it to carry out arithmetic on time and date values without youhaving to write any complex expressions. Excel’s internal time/date format treats time asstarting from midnight on 1st January 1900. (Most of the time you don’t have to be awareof that, although it does mean that you cannot calculate with dates earlier than 1900directly.)
  • 62. Setting display formats for data 59Here’s a short exercise to show different date formats:1. Start with a blank worksheet.2. Select any cell and enter 1/1/0 Tab (1st January 2000)3. Note how Excel formats the date when you Note press Tab.4. Reselect the cell and then select Format ➪ It’s very important to realise that the Cells… Note that Date is already selected as cell’s format only affects the way a the cell format’s Category. numerical value is displayed. Excel5. Click to examine the Locale menu. This is always holds numerical data in the same format internally. where you can select date formats appropriate to other countries if you need to.6. Scroll to the last option in the Type list, 14 March 2001, then click on OK. Time and date arithmetic Excel allows you to add and subtract dates and times without further complication. You can even multiply and divide them, although the results can be meaningless! However, Excel’s ‘persistent’ formatting can be confusing here. To demonstrate this: 1. Open a blank workbook. 2. In cell A1, enter the following: 1/1/04 Return 2/1/04 Return 3. In cell A3, enter: =A2-A1 Return What’s this? A3 now contains ‘01/01/1900’. What’s going on? In fact the result is correct, but the problem is that Excel has taken the automatic date format from A1 and A2 and applied it to A3. Logical, but wrong. 4. Using Format ➪ Cells… apply the General format to A3. Now you get the correct answer, 1 day.Calculating and formatting percentagesPercentage values are used a great deal in business. Excel makes it easy to calculate andformat percentages. In fact, all that Excel does when you apply a percentage format to acell’s contents is to multiply the value the cell contains by 100 before it displays the result.Similarly, if you enter a value in a cell that has a percentage format applied, Excel dividesthat number by 100 internally before using it in calculations.
  • 63. 60 Step 4—Improving a sheet’s appearanceTo see how this works in practice:1. Start with a blank worksheet.2. Click in A1 to select it, then enter: 12 Return 4 Return3. In A3, enter =A2/A1 A3 now contains the content of A2 divided by the contents of A1, or 3.3333.4. Select A3 again, then select Format ➪ Cells… In the Format Cells dialog, select the Number tab, then select Percentage from the list of formats. Click on OK. A3 should now display 33.33%. This is the percentage that 4 is of 12, i.e. one third, or 33.33%.So, to work out what percentage a number A is of a number B, divide B by A and apply apercentage format to the result. You can apply the percentage format easily by clicking onthe button in the formatting toolbar, although this restricts you to whole numbers only.Here’s how to calculate and display what a given percentage B of a number A is:1. Click in A1 and enter the number A. Click Return.2. In cell A2, select Format ➪ Cells… In the Format Cells dialog, select the Number tab, then select Percentage from the list of formats. Click on OK.3. Enter your desired percentage in A2, then click on Return.4. In A3, enter =A1*A2 Return. A3 will now display the number that is the percentage A2 of the number in A1. For example, if A1 contains 200 and A2 contains 33%, A3 will display 66, or one-third, 33%, of 200.These simple exercises show how Excel’s handling of percentages makes it easy to calculateand display them. As you can see, the percentage format both:■ Converts a decimal fraction into a percentage for display.■ Converts an entered percentage into a decimal fraction, so that the percentage can be calculated using multiplication.Defining your own formatsIf none of the display formats meet your needs, you can add your own. For example, assumethat you want to add a word to describe units such as weeks. You might want to do this fora calendar or some other form that listed week numbers.
  • 64. Setting display formats for text 61It’s easy to do:1. In a blank cell, enter the number to be displayed, say 12.2. Select Format ➪ Cells… In the Format Cells dialog, select the Number tab, then select Custom from the list of formats.3. Under Type, select 0. This will display whole integer numbers only.4. Click in the editing window beneath Type and enter "Week" and a space before the zero. Click on OK.Your week number should now display as Week 12. Excel will remember this format andsave it with the current worksheet.Excel allows you to create complex custom formats for display of date, time and numericalinformation. For example, you might need a special format for a product code, somethinglike 12-453678-AW. This is possible in Excel. Equally, you can define a format that displaysone text legend if a number is positive, another if the number is negative, such as ‘Profit’and ‘Loss’.The formatting codes that are available are well described in Excel’s on-line help under‘Number format codes’. Take a few moments now to browse the help and see what’savailable.Setting display formats for textWe mentioned on page 56 that the Format Cells dialog contains tabs for Number, Alignment,Font, Border, Patterns and Protection. This is where you get to find out all the interestingthings they do.Setting font stylesYou have already come across the button in Using relative and absolute cellreferences on page 47, used to set headings and similar items in bold. Similarly, theitalic and underline buttons allow you to add these effects quickly.If you want to go beyond this, a full set of text formatting functions similar to Word’s arelocated in the Format Cells dialog. We’ll use them here to change the fonts in your shoppinglist workbook:1. Reopen the shopping list workbook.2. Click on the select all button.3. Select Format ➪ Cells… In the Format Cells dialog, select the Font tab, then choose a different font in the Font list. Use a serif font such as Book Antiqua, Garamond,
  • 65. 62 Step 4—Improving a sheet’s appearance Georgia or Palatino. (The exact fonts installed on your computer may vary.)4. Select a smaller font size, for example 9 point, under Size.5. Click on OK. Excel applies your choice of font and size to the entire worksheet. Note that the titles that you previously set in bold are still bold—Excel has applied the relevant bold font to the titles.Save your shopping list workbook with the changes, as we’ll be using it again later.One style in the Format Cells Font pane that you may not have come across before that isquite important is ‘double accounting’. This is used on financial reports to highlight finaltotals—while single underline is used for subtotals. These styles differ from the standardsingle and double underline in that they place more space between the number and theunderline. We’ll use one now to highlight our shopping list totals:1. Re-open your shopping list workbook if you need to.2. Click and drag to select the two totals figures, which are probably cells C8:D8.3. Select Format ➪ Cells…4. In the Format Cells dialog, select the Font tab, then select Double Accounting in the list beneath Underline. Click on OK.Your worksheet should now look something like this. The font used in this illustration is 9-point Book Antiqua:Save the changes you have made to the workbook.Setting colours and backgroundsSo far we have steered clear of decorative effects in Excel. However, you won’t be surprisedto hear that it has them a-plenty. What is more surprising is that they can be very useful, forexample for highlighting specific areas or figures within a worksheet.
  • 66. Setting display formats for text 63For example, your shopping list, although only simple, has three different areas:■ The list of items■ The totals line■ The statistics section.In this exercise, we’ll add coloured backgrounds to make these more distinct:1. Re-open your shopping list workbook if you need to.2. Click and drag to select the items list and Tip their titles. These are probably cells B2:E6 in your worksheet. When highlighting cells, stick to pale3. Select Format ➪ Cells… pastel shades to avoid reducing the In the Format Cells dialog, select the contrast of the text. Patterns tab, then choose a colour to highlight the selected cells. Click on OK.4. Repeat step 3 for the Total line, using a different colour if you want to.5. Repeat step 3 for the Costliest, Cheapest, No of items and Average cost cells, again using a different colour if you want to. Finally, we’ll change the colour of the actual Tip totals figures. This is done using the Font pane of the Format Cells dialog, so… Coloured text or numbers, as opposed6. Select the two totals figures only, probably to tinted areas, are most useful to cells C8:D8 in your worksheet. indicate status information such as7. Select Format ➪ Cells… positive or negative amounts. You can include colour in this way in custom In the Format Cells dialog, select the Font number formats—see Excel’s help on tab, click on the widget adjacent to the Color ‘Number format codes’. field, and choose a colour. Click on OK.Save the changes to your shopping list workbook.Setting text alignment, wrapping and directionHopefully by now your humble shopping list is starting to look quite professional. You mayhave noticed that the numbers are aligned to the right of their respective cells, while thetext, such as the titles, is aligned to the left. These are Excel’s default settings, but they areeasy to change.
  • 67. 64 Step 4—Improving a sheet’s appearanceYou can set test alignment quickly and easily using the left, centre, and rightalignment buttons in the Formatting toolbar. Alternatively, the Alignment pane ofthe Formatting Cells dialog gives you full control. In the exercises below, we’ll use both:1. Re-open your shopping list workbook if it is not already open.2. Click and drag to select the titles Pounds and Euros.3. Click on the right-align button4. Click and drag to select the Above average? title and the No/Yes cells below it.5. Click on the right-align button again. The Above average? column looks better now, but we’re still not quite happy with it. Would it look better if it were narrower?6. Click on the column title (E in our examples) to select the whole column.7. Right-click and select Column Width… Excel displays the Column… dialog:8. Enter a value of 8 and click on OK. Can you see what’s happened? We now cannot see the whole of the Above average? title. However…9. Select the cell containing the Above average? title.10. Select Format ➪ Cells… and click to select the Alignment pane.11. Click in Wrap text to select it, then click on OK.Note how the text has wrapped, and that the row height has increased to accommodate it.Placing text across several columnsNext we’ll add a banner heading to span several columns:1. Click in B1 to select the cell.2. Enter Shopping List Tab, then reselect cell B1 and click on the button to set the words in bold.3. Now click and drag to select cells B1:E1, then click on the merge and centre button The cells are merged, and centre alignment is applied to the title in cell B1.When you have finished, save your shopping list workbook.
  • 68. Using cell borders 65Excel remembers that the title was originally in cell B1—if you reselect cells B1:E1 and clickon the button again, the cell merge is reversed. You could have achieved the same resultby:1. Selecting cells B1:E1.2. Selecting Format ➪ Cells…3. Clicking on Alignment.4. Selecting Center for Horizontal.5. Clicking in Merge cells to select this option.You’ll find that the button saves a lot of time here!Setting text directionBefore we leave this topic, select Format ➪ Cells… again and click on the Alignment pane.Note the Orientation selector. Click and drag to set text alignment… …or enter a numerical angle in degrees here Figure 4.2 The Alignment pane of the Format Cells dialogThis allows you to set the angle at which text is displayed. For example, you could mergeseveral cells in a column and set text alignment to 90 degrees to place text vertically.Using cell bordersWe used coloured fills to highlight the different areas of our simple example worksheet. Forsome applications, such as forms, making areas of a worksheet look like a table or form ismore appropriate. You do this using cell rulings, which Excel refers to as ‘borders’. These
  • 69. 66 Step 4—Improving a sheet’s appearanceoffer useful visual cues, for example to help users understand which areas of a worksheetare for data entry, and which contain calculated results.Here is an example, taken from the Loan Amortization template supplied with MicrosoftOffice XP. This is optionally installable into the Spreadsheet Solutions folder for Exceltemplates. We have adapted it only by changing the currency symbols from ‘$’ to ‘£’. Figure 4.3 Loan repayment calculatorNote how the worksheet makes use of ruling to provide visual cues. It is not obvious fromthis figure, but it also uses shading to denote calculated results.This is an example of a fully-fledged worksheet designed to be usable ‘out of the box’. Ituses many of Excel’s more advanced features, and it is a worthwhile exercise to install andexamine it. You can do this by:■ Selecting File ➪ New…■ Clicking on General Templates… in the task pane■ Selecting Spreadsheet Solutions and Loan Amortization .If these extra templates have not been installed, you will be prompted for the installationCD-ROM. Follow the instructions on the screen.Now we’ll add some borders to our shopping list to see how it’s done:1. Reopen your shopping list worksheet if you need to.2. Drag to select cells B2:E6 (or the titles and amounts in your example).
  • 70. Protecting a sheet’s contents 673. Select Format ➪ Cells… and click on the Border tab. Excel displays the dialog shown in Figure 4.4. Figure 4.4 Excel’s cell border dialog The Presets allows you to quickly set or clear the outer or inner rulings for a group of cells.4. Click on one of the heavier solid line styles Note under Style, then on Outline. Notice how the Border diagram illustrates You must always select the line style the resulting effect. first, then apply it using a preset or the5. Now select one of the dotted line styles Border map, rather than the other way under Style, then click on Inside. around.6. Click on OK, then save your worksheet.Although this is only a simple shopping list, you can use the techniques you have learnedhere to construct professional-looking worksheets of your own. Only one key technique noremains to be learned—how to stop other users changing your formulae.Protecting a sheet’s contentsTo create a robust worksheet that can be used by others, you need to use two techniques:■ Hiding cells that contain information you do not want others to see or change■ Protect cells that contain formulae from accidental change.
  • 71. 68 Step 4—Improving a sheet’s appearanceThis section shows you how achieve this. We will, as before, use our simple shopping listexample, but the techniques are applicable to spreadsheets of any complexity. There aretwo main ways of concealing information in Excel:■ Hiding rows or columns■ Using a separate worksheet.Hiding rows and columnsIn our shopping list example, we have a couple of cells that are the ‘odd ones out’—the euroconversion rate. Here’s how to conceal them by hiding the columns:1. Reopen your shopping list worksheet if it’s not already open.2. Click in the column titles of the columns the data occupies (probably F and G) to select them.3. Select Format ➪ Column ➪ HideExcel conceals the selected columns. Of course, one problem with this technique is that youmight forget that the columns were there in the first place!To reveal the columns again, the easiest method is to select the entire worksheet and thenselect Format ➪ Column ➪ Unhide. Do this now. Why hide rows and columns? You might be wondering at this point why one would want to hide rows or columns. You discovered in Using mixed cell references on page 49 that you can ‘nest’ Excel functions, using brackets, to build up complex formulae. However, many nested brack- ets make a formula hard to read, edit or understand. A better way to construct complex formulae is to use multiple cells to calculate different parts of the formula, referencing the results in subsequent cells. This also makes complex formulae much easier to test and debug. If you use this technique, you want to hide these cells from view, otherwise they will display partial calculations and confuse people who use your worksheet.Using separate worksheetsThe other way to conceal data you don’t want people to see or be able to access is to put iton a separate worksheet. We’ll do that now with the euros conversion factor:1. Reopen your shopping list worksheet if it’s not already open.2. Click to select the title Euros per Pound and the conversion factor.3. Right-click and select Cut.
  • 72. Protecting a sheet’s contents 694. Click on the worksheet tab for Sheet 2.5. Click anywhere convenient in Sheet 2.6. Right-click and select Paste.7. Click on the worksheet tab for Sheet 1 again. Notice that the euros figures are still correct.8. Click to select the cell containing the first amount in euros. The formula bar should show something like this: =C3*Sheet2!$C$3 This is how Excel expresses references that cross between worksheets.9. Now right-click on the worksheet tab for Sheet 2, and select Rename.10. Enter Euros as the worksheet’s name, then click on the tab for Sheet 1.If you still have a cell containing a euro amount selected in Sheet 1, you will see that Excelhas changed the formula to =C3*Euros!$C$3. Giving worksheets meaningful names like thisis helpful.Using cell locking and worksheet protectionIf you looked at the loan repayment worksheet in the last section, you will have discoveredthat you could only enter data where the worksheet allowed you to. You couldn’t evenselect other cells.This is achieved using a feature that Excel calls cell protection. Cell protection allows you tolock all or some cells in a worksheet, as well an entire workbook. Cell protection consists oftwo parts:■ The lock/unlock property of each cell■ The protection setting for the worksheet.For a cell to be non-editable, it must be locked and the worksheet must be locked. In a newworksheet, all cells are locked by default, but the worksheet is not locked. This means thatyou can edit normally within the worksheet. When you apply protection to the worksheet,therefore, all cells become non-editable.To make only certain cells editable, you need to clear the locks on these cells, then lock theworksheet. For example, in your shopping list worksheet, the only cells where you want tobe able to enter data are the items and the amounts in Pounds. All the other values on theworksheet are calculated—that is, their cells contain formulae. Here’s how to protect thecells you don’t want to be changed:1. Reopen your shopping list worksheet if it’s not already open.2. Select the cells that form the Item and Pounds columns, for example cells B3:C6.3. Select Format ➪ Cells… and click on the Protection tab.
  • 73. 70 Step 4—Improving a sheet’s appearance4. Click in Locked to clear the cell lock flags, then click on OK.5. Now select Tools ➪ Protection ➪ Protect Sheet… Excel displays the Protect Sheet dialog, as shown in Figure 4.5. Figure 4.5 Excel’s Protect Sheet dialog This allows you to selectively add back ‘prohibited’ activities to a locked worksheet. You aren’t interested in partially locked worksheets at this stage, so deselect all options except Select unlocked cells , then click on OK.You should now find that you can only select and Warningedit the cells for items and amounts in Pounds—everything else is locked. Note that by You may have noticed that the Protectpreventing users of the worksheet from being Sheet dialog allows you to set aable to select locked cells, you have also password that must be suppliedprevented them from viewing those cells’ before the worksheet can be unlocked.contents. If you do this and forget the password, there is no way that you can thenTo protect an entire workbook, select Tools ➪ unlock the worksheet. Ever. BeProtection ➪ Protect Workbook… This allows you careful!to prevent others from resizing the workbook’swindow or adding or deleting additionalworksheets.Congratulations—you now have a fully functional, formatted and ‘ruggedised’ spreadsheet.Admittedly it only does something very simple, but the techniques you have learned areequally applicable to much more complex problems. There only remains one final touch,before you save your shopping list—think of it as the icing on the cake:1. Select Tools ➪ Options…2. Click on the View tab.
  • 74. Protecting a sheet’s contents 71 3. Deselect Gridlines and Row & column headers . 4. Click on OK. You now have a nice little interactive form that hardly looks like a worksheet at all, as Figure 4.6 shows. To get the gridlines and headers back, just reverse the steps above.Done! Figure 4.6 The finished worksheet
  • 75. 72 Step 4—Improving a sheet’s appearanceReviewIn this step, you learned that:■ Excel has a wide range of cell formats for numerical, date, time, and financial data.■ You can copy and paste formats between cells.■ You can add number separators such as commas to make large numbers more readable.■ You can add and subtract date information—although you have to be careful about formatting.■ Excel’s formatting for percentages makes it easy to work with them.■ You can define your own cell formats, and these can be quite complex.■ Excel has similar controls for font, size, and colour as does Word.■ You can colour or shade cells or groups of cells, which can provide visual cues for the worksheet’s user.■ Excel has a comprehensive set of controls that allow you to wrap text in cells, span text across multiple cells, and set text at any angle.■ Using cell borders allows you to simulate forms in a worksheet, making it easier to understand.■ Hiding rows and columns is a useful way of storing and protecting complex calculations.■ You can use a separate worksheet to store data you don’t want to be displayed.■ Excel updates relative cell references when you move data to another worksheet within the same workbook.■ Cell locking allows you to ensure that only cells designed to receive data are editable.
  • 76. Protecting a sheet’s contents 73Quiz1. What do cell formats do?2. If you’re not happy with the format that Excel has applied to a cell, which command allows you to change it?3. Name one difference between Excel’s Number formats and its Accounting formats.4. What is a number separator, and why is it useful?5. If you entered 12/1/05 in cell A1, 20 in B1 and =A1+B1 in A2, what would cell A2 display?6. If you entered a number A in A1 and another number B in B1, how would you calculate and display the percentage that A is of B?7. What is the difference between setting an underline on a cell’s contents and adding a lower border to a cell?8. What does the Orientation selector in the Alignment pane of the Format Cells dialog do?9. Why might you want to hide rows or columns in a worksheet?10. For a cell’s contents to be protected from change, two things must be true. What are they?
  • 77. STEP Working with charts and graphs 5 Checklist ■ The difference between charts and graphs ■ How to create a simple pie chart ■ How to create different types of chart ■ Adding legends to your chart ■ Editing charts and graphs ■ Copying and moving charts and graphs ■ Adding a linked chart to a Word documentU p to this point in our work with Excel we have only dealt with numbers and text. Excel has another huge and very important trick up its sleeve, though—it is very good indeed at displaying data graphically. Visual display of information is oftena great deal easier for readers to grasp quickly than columns of figures, so it is important tobe able to use Excel’s chart and graph features.What’s a chart, what’s a graph?By now you may be becoming alarmed, particularly if you are one of the many of us forwhom mathematics is a tricky, or even terrifying, subject. However, you don’t need toworry—Excel makes it all very easy. But first we have to define what we mean by chart orgraph:
  • 78. 76 Step 5—Working with charts and graphs■ Chart is a term that has come to us from America. It tends now to be applied to any graphical representation of data that is not a traditional graph. For example, the terms bar chart and pie chart are very common in business: – A bar chart represents numerical quantities as vertical or horizontal bars in which the length of the bar represents the size of each value. – A pie chart represents proportions of a whole, or percentages, as slices of a flat cyl- inder, or ‘pie’, in which the size of the slice represents that quantity’s proportion of the whole. Because Excel is an American product, it tends to refer to all graphical representations of data as ‘charts’.■ Graph is a term with a specific mathematical meaning, in which numerical data with more than one dimension is plotted on as many axes as there are dimensions to the data. This sounds complex, but it isn’t really. Consider the following pairs of numbers: 1 – 12 2.3 – 24 3 – 15.4 4.5 – 16
  • 79. Creating a simple chart 77 Such numbers could represent the relationship of one thing to another—it doesn’t mat- ter what at this stage. Here’s what they look like as a graph: Can you see that it’s much easier to see the relationship between the two sets of values when they are displayed like this?Although Excel refers to all graphical displays of data as ‘charts,’ we’ll use the terms in usein the UK here.Excel applies the term series to the data used in the charts and graphs above. This is shortfor data series, and all it means is a set of related data. For example, your shopping listconsists of a list of pairs of information, in this case items’ names and their prices. This iswhat Excel refers to as a data series. Similarly, the list of numerical values in the graphexample is a data series. Each individual data item in a series is referred to as a data point.Excel has no problems plotting a chart or graph with more than one data series.Creating a simple chartLet’s see just how easy it is to create a chart. We’re going to produce the pie chart shownon the preceding page, which is based on your shopping list workbook. Excel makes it reallyeasy to do this by providing a Chart Wizard:1. Open your shopping list workbook again. If you left the worksheet that contains the data protected, you will need to clear that protection, otherwise Excel won’t allow you to add a chart to the worksheet, so…2. Select Tools ➪ Protection ➪ Unprotect Sheet… If the Protection menu shows Protect Sheet… instead, the sheet is already unprotected.3. Click and drag to select the items and their corresponding cost in pounds (cells B3:C6).4. Select Insert ➪ Chart… Excel displays the first dialog of the Chart Wizard, shown in Figure 5.1. This allows you to choose from the many types of graph and chart that are available.5. Select Pie under Chart type, then choose the second option, the 3-dimensional pie chart. Click on Next >.
  • 80. 78 Step 5—Working with charts and graphs Figure 5.1 Excel’s Chart Wizard—first dialog6. In the second wizard dialog, ensure that Series in columns is selected. This means that Excel will treat each of the two selected columns of data as the two parts of each data point. Click on Next >.7. Add a title for your chart in the third wizard dialog if you wish, for example Shopping. Click on Next >.8. The fourth and final wizard dialog offers you the choice between: ■ Embedding the chart in the current worksheet ■ Creating a new worksheet and placing the chart there. Both of these options have advantages and disadvantages, which we discuss below. For this exercise, accept the default, which is to embed the chart in the current worksheet.9. Click on Finish.Excel creates the pie chart for you and displays it in the current worksheet—probablyobscuring your data. You can click and drag it to a new location if you wish. The chart is‘live’—it is still connected to your data, as you can demonstrate by entering a new value for,say, meat. Did the chart change?Finally, save the shopping list workbook, as we will use it later.
  • 81. Creating other types of chart 79 Embedded versus floating charts Whether you choose to embed a graph or chart in a worksheet, or to give it its own worksheet, depends largely on the design of your application and how you intend it to be used: ■ Embedding a chart in a worksheet allows you to see the chart change as the data changes. This is useful if you are using the worksheet to analyse data. However, it can obscure your working area unless you are running Excel on a monitor with a large screen. It also means that you cannot easily print just the chart. (We deal with printing worksheets in Step 6.) ■ Giving a chart its own worksheet leaves you with more working space on your data worksheet, but means that you cannot see both the data and the chart at the same time. It does make it easy to print just the chart, however.Creating other types of chartYou saw in the first dialog of the Chart Wizard that Excel can createmany different types of chart and graph. Some are purely decorative,others place specific requirements on your data, and do not make senseif the data does not meet those requirements. For example, X/Y scatterplots are not meaningful unless each data point has at least twonumerical values. More exotically, ‘bubble’ plots, shown on the right,relate three sets of numerical values, in which the size of the bubble isused to represent the third variable.In the next exercise, we’ll use a bar graph format to display both thepounds and euros data from your shopping list. This is thus a 2-serieschart, as it displays two sets of numerical data:1. Reopen the shopping list workbook if it’s not already open.2. Click and drag to select the data in the Item, Pounds and Euros columns, including the titles.3. Select Insert ➪ Chart…4. Select the fourth option in the Chart Wizard dialog, for the two-dimensional bar chart. Click on Next >.5. In the second dialog, accept the default, series in columns. Click on Next >, then click on Next > again to dismiss the data label options, as we don’t want to change any of these.6. In the fourth wizard dialog, click in As new sheet, then click on Finish.
  • 82. 80 Step 5—Working with charts and graphsExcel displays your 3-D bar chart with values for pounds and euros. However, there’s aminor problem. Excel has used its ‘intelligence’ to label the vertical axis in pounds, whereaswe want it to indicate both pounds and euros. It should not therefore have any units. Here’show to fix this:1. Double-click on any value on the vertical axis. Excel displays the Format Axis dialog. This should looks familiar to you—its Number pane is identical to the Number pane of the Cell Format dialog.2. Under Category, click on Number. Leave the decimal places at 2.3. Click on OK.Now the graph looks as we want it to. To see the tricks Excel allows you to use with 3-Dcharts, click on the front right-hand corner of the bar chart to select it, release the mouse,click again and drag. This might require a few tries, but when successful you should get a‘wireframe’ outline of the chart. Dragging it allows you to set the relative viewpoint of thechart—even from below!In the example shown here, we’ve also set the legends to 16-point Arial Bold, as this text ismore in proportion to the chart itself. We’ll show you how to do that later in this step.Meanwhile, save the changes to your shopping list workbook.Adding legends to your chart or graphYou have already seen how to use the options in the Chart Wizard to add legends to a chart,and how to edit the formats of axes legends. Excel has many options for adding legends tocharts. These tend to be specific to the type of chart or graph you are using. These areavailable from the Chart Options dialog, which differs between different chart and graphtypes.
  • 83. Editing charts and graphs 81To try this out:1. Reopen the shopping list example workbook if it’s not already open.2. Use the worksheet tabs to make sure that Sheet 1 is displayed.3. Right-click on the pie chart and select Chart Options… from the pop-up menu. Excel displays the Chart Options dialog. Warning4. Click on the Legend tab and experiment with the different legend positions. Excel displays different pop-up menus5. Click on the Data Labels tab and experiment depending on which part of a chart is with the various options. selected. This can lead to some confusion. For the examples here, Note that the Percentage option allows you when we say ‘right-click on the… to display numerical information that was chart’, we mean the white space not available before. surrounding the chart object, not the6. When you have finished trying out the chart itself. options, close the Chart Options dialog by clicking on Cancel, then select your 3-D bar chart by clicking on the Chart1 worksheet tab.7. Right-click on the chart and select Chart Options… Note that this time the Chart Options dialog has panes for Axes and Gridlines.8. Click on the Titles pane and add titles for Chart title (whatever you like) and Amount for Value (Z) axis .9. Click on the Legend tab and experiment with different legend positions. Choose whichever you find most pleasing.10. Click on the Data Labels tab and experiment with the options there.11. Click on the Data Table tab and add a data table to the preview to see what it does. Don’t add it to your graph, though.12. When you have finished, click on OK to close the Chart Options dialog.This exercise should give you a good idea of the options available for charts and graphs.Remember that these vary depending on the type of chart or graph with which you areworking.Editing charts and graphsEditing items in charts and graphs is very simple. All you have to do is:■ Select the item to be edited, right-click and: – Select the relevant Format option, or – Select Clear to delete the item, or
  • 84. 82 Step 5—Working with charts and graphs■ Double-click on the item you want to edit.We’ll demonstrate this on the pie chart you embedded in your shopping list:1. Reopen the shopping list example workbook if it is not already open.2. Click on the title, Shopping. Excel displays the text box for the title: Text box3. Click after the word Shopping. You should get a text cursor. Enter the word List.4. Double-click on the legend. Excel displays the Format Legend dialog. Figure 5.2 Excel’s Format Legend dialog5. In the Patterns pane, select a pale grey and click in Shadow.6. In the Font pane, change the font to Arial Bold.7. In the Placement pane, change the legend placement to Left.8. Click on OK.9. Double-click on the pie chart object. In Data Labels, select Percentage. Click on OK.10. Now double-click on the entire chart. Excel displays the Format Chart Area dialog, which is similar to the Format Legend dialog.
  • 85. Editing charts and graphs 8311. In the Patterns pane, select a pale pastel colour and click in Round corners.12. Finally, click on OK.When you have finished, save your changes to the workbook.Colour is a useful device both for making your worksheet look more attractive and fordrawing attention to specific areas. The enhancements you make are a matter of taste, butyou should always aim for simplicity and clarity.As an exercise, try some of these techniques on Tipthe bar chart contained in the Chart1 worksheet.Note that this chart has more objects you can To change the colour of only one sliceclick on than the pie chart—it has axes and, of a pie chart, click once to select thebecause it is a 3-D bar chart, the ‘walls’ and entire pie, then again to select the‘floor’ have their own properties too: single slice. You can then use the methods described above to change■ Try changing the scale options—just the slice’s colour, or even move it out double-click on the vertical axis labels. of the ‘pie’■ Try changing the bar colour—double-click on a bar.■ Change all the fonts to 16 point Arial Bold—double-click on a legend and select the Font pane of the relevant Format dialog that is displayed.Changing a chart’s typeIf none of the options for a particular chart type seem to be right, Excel allows you to changethe type of a chart even after you have placed and edited it. Try this now:1. Reopen the shopping list example workbook if it is not already open.2. Right-click on the embedded pie chart in Sheet1, and select Chart Type…3. Select a completely different chart type, such as the fifth option under Cylinder. Click on OK.4. Use the techniques you learned in the previous section to change the font to Arial Bold.
  • 86. 84 Step 5—Working with charts and graphs5. Click on the chart object to select it, then drag the top border up to make the chart taller.With luck, you’ll end up with something like this.Editing a chart’s data rangeYou may find, once you’ve created a chart or graph, that you need to change the source datafor the chart. For example, if the data is contained in a table within a worksheet, and youadd to it, you will want to include the new data in the chart.Excel makes this easy to do. You have two options, both controlled from the Source Datadialog:■ Redefine the data range by clicking and dragging■ Redefine the data range by directly editing the data series specification.To see how this works, we’ll change the data range on the pie chart in our shopping listworkbook:1. Reopen the shopping list example workbook if it is not already open.2. Right-click on the pie chart and select Source Data… Excel displays the Source Data dialog, as Figure 5.3 shows.3. You have two options here: ■ Edit the source data range for the chart in the Data range field. For example, here it is currently =Sheet1$B$3:$C$6—that is, an absolute reference to the range of cells B3:C6 in Sheet1. ■ Click on the button to the right of the Data range field. When you do this, the dialog contracts to allow you to see the worksheet and to adjust the data range by clicking and dragging a new selection of the source data. (This works even if the source data is on a different worksheet.) When you have finished, clicking on the button again restores the dialog. Try both of these methods now to reduce the data range to B3:C5, and see what
  • 87. Copying and moving charts 85 Figure 5.3 Excel’s Source Data dialog happens. Note that the preview in the Source Data dialog shows you the effect—you don’t have to click on OK to see what will happen.4. When you have finished experimenting, close your workbook and discard the changes.Copying and moving chartsTo move a chart or graph within a worksheet, just click on it and drag it to the requiredlocation. If the chart or graph is the only object in a worksheet, Excel automatically allocatesit the full worksheet, so you cannot move it by dragging.You can cut and paste charts and graphs in the Tipsame way as you would any other data in Excel.To cut or copy a chart, just right-click on the When you copy a chart to its ownchart and select Cut or Copy from the pop-up workbook, the live data links remainmenu. You can then paste the chart in another to the chart’s source workbook.worksheet or even another workbook.Try this now:1. Reopen the shopping list example workbook, if it is not already open.2. Right-click on the shopping list pie chart and select Cut.3. Select File ➪ New… and click on Blank Workbook in the task pane.4. Right-click in cell A1 and select Paste.
  • 88. 86 Step 5—Working with charts and graphs Excel pastes the pie chart into the new workbook’s Sheet1 worksheet.5. Save the new workbook. Call it Shopping Pie (or anything else that takes your fancy that you can remember).6. Position both workbooks so that you can see them on the screen. You may have to make either or both windows smaller to do this. See Figure 5.4.7. Change items in the cost data in the shopping list worksheet. Verify that the pie chart changed—the pie chart remains linked to the shopping list data, even though they are in different workbooks.8. Click to select the workbook containing the pie chart. Right-click on the chart and select Source Data… Note that the data specification in the Data range field is: =(Shopping list.xls)Sheet1!$B3$C6 This is how Excel expresses an absolute reference between workbooks. It’s made up as follows: Shopping list.xls The file name of the workbook containing the source data Sheet1 The name of the worksheet within the workbook contain- ing the source data $B3$C6 The absolute cell reference within the worksheet9. Click OK to close the Source Data dialog, then save both workbooks.Adding charts to Word documentsOne very useful feature of Excel and Word is the ability to embed ‘live’ Excel charts andworksheets in Word documents. Here’s how to do it:1. Re-open the workbook that contains your Warning pie chart, if it’s not already open.2. Right-click on the pie chart object and select Linked data is updated between Excel Copy. workbooks as soon as the data3. Start Word with a new blank document. changes as long as both workbooks are open. However, data is only You can of course also do this with an exist- updated between an Excel workbook ing Word document—we are only using a and a Word document when the Excel new document here for the sake of the workbook that contains the data is exercise. saved.4. Click in the Word document where you want to paste the chart.5. Right-click and select Paste, or click the button on Word’s formatting toolbar.
  • 89. Adding charts to Word documents 87 Figure 5.4 Linked workbooks 6. Click on the paste options button at the bottom right of the pasted chart and select Link to Excel Chart . The chart in the Word document will now remain linked to the data in the Excel worksheet containing the chart. If you double- Paste optionsDone! click on the chart in Word, Excel is launched and opens the workbook containing the chart. This is referred to as an embed- ded chart.
  • 90. 88 Step 5—Working with charts and graphsReviewIn this step, you learned:■ Charts and graphs are very important for representing numerical data visually.■ Excel has a wide range of charts and graphs built in.■ Charts and graphs are plotted from a data series, which is made up of data points.■ Excel’s Chart Wizard makes it easy to add a chart or a graph to a worksheet.■ You can embed a chart or graph in a worksheet, or put it in a worksheet of its own.■ Both methods have advantages and disadvantages.■ It’s easy to add legends to your chart.■ Once you have created your chart, it remains linked to the data series it displays.■ You can edit anything in a chart or graph, including the data series it displays, and even the chart type itself.■ Charts and graphs can be copied and pasted to other worksheets or workbooks and still retain their ‘live’ link to the original data series.■ Charts and graphs can be copied and pasted to Word documents, and retain their ‘live’ data links to the Excel workbook containing the data series if the correct option is used.Quiz1. If you want to plot how a car’s fuel consumption varies with its speed, would you use a chart or a graph?2. Why do pie charts always illustrate percentages, no matter what the data?3. Embedding a chart in the worksheet that contains the data series it displays, rather than its own worksheet, gives you some advantages. Name one.4. If you wanted to add items to the data series displayed by a chart, which command would you use?5. What does the Data Table pane of the Chart Options dialog do?6. How do you change the colour of a chart’s background?7. How would you change the colour of a single slice of a pie chart?8. How could you add more ticks to the vertical scale of your bar chart? Try it and see if it works.9. If you open an Excel workbook and find a chart whose data range is shown as: =(Rabbit breeding.xls)Population!$B2$C12 what would it tell you?10. Word lets you embed an Excel chart that is linked to the Excel workbook containing its source data, so that changes to the source data cause changes to the copy of the chart in the Word document. When might this be a bad idea?
  • 91. Preparing and STEP printing data 6 Checklist ■ Checking the maths in your worksheet ■ Checking your spelling ■ Setting the area to be printed ■ Adding headers and footers ■ Setting the page breaks ■ Setting printing options ■ Printing a worksheet or workbook ■ Saving a workbook in an alternative file formatT his step tells you how to get your Excel data onto paper. Excel has similar printing controls to Word, but also has some unique abilities. This step follows the preparations for Tipprinting in a logical order. However, don’tassume that this is a fixed order that must always If all or part of your workbook isbe followed. You will probably find, for example, intended to be printed at any stage,that you make many visits to the Print Preview it’s a good idea to design it with this inwhile adjusting printing options. mind from the start.
  • 92. 90 Step 6—Preparing and printing dataHow Excel prints workbooksAn Excel workbook can contain many worksheets, tables, chart or graphs. When you printinformation from a workbook, Excel gives you several options:■ You can print the entire workbook■ You can print only the active worksheet■ You can print just a selected area from the active worksheet.In addition, you can add headers and footers to each sheet. Excel offers a wide range of dataobjects to construct headers and footers, such as time, date, page number, and file name. Iteven allows you to insert graphical objects in headers and footers.We will demonstrate these options as we encounter them.Preparing a worksheet for printingBefore you print your work in Excel and—most likely—give it to others, it’s vital to ensurethat it is correct. There are several aspects to this:■ Ensuring that all calculations are correct. Excel offers you no shortcuts for this, you just have to check through carefully. However, it’s often useful to apply unary (one) and zero values as a check, depending on the calculations involved. For example, if your worksheet calculates, say, the prices for a quantity of various products, setting the quantities to 1, or 10, and the price to a round number such as 2 or 5, 20 or 50, allows you to visually check results more easily. It’s also important to check that all cells that are supposed to contain the same formula, actually do. You should also check that your worksheet does not contain any of the errors shown in the table in Understanding Excel error messages on page 49. Excel does offer the ability to check through for errors in formulae. We describe this below.■ Checking spelling. Excel has a built-in spelling checker like Word’s. This allows you to spell-check all the text in a worksheet easily. We describe how to use it below.■ Checking formatting. This is best done visually, and involves checking that all text and numbers are formatted consistently, use the correct font and so on. For example, have you used the correct formatting for all currency values? What happens if a value is negative? It is shown correctly?
  • 93. Preparing a worksheet for printing 91Checking for errors in formulaeIf you are working on a large or complex Noteworksheet, you may have chosen to ignore someof the error messages you encountered. Excel This feature checks for errors in syntaxallows you to check for all errors in formulae, or use of Excel formulae, such aseither in one operation or cell by cell. dividing by zero, incorrect nesting of brackets, or circular references. It doesHere’s a short exercise that illustrates how these not guarantee that your formulae willfeatures work: give the correct result, as it cannot1. Reopen the shopping list example know whether or not you have workbook. specified the correct formula! That is up to you.2. Select Tools ➪ Options…, click on Error Checking, and ensure that Enable background error checking is selected. Click on OK.3. Enter a deliberate error. For example, click in the first amount in the Euro column and change: =C3*Euros!$C$3 to =C3*Euros!$C$3/0 This introduces a deliberate divide by zero error. Your worksheet should now look like this: As you can see, the divide by zero error has propagated to the euro totals, costliest, cheapest and average values. Excel has also highlighted the cells that contain errors by placing a small green mark in the top-left corner of each cell.4. Click to select one of the cells which contains an error. Excel displays a small error button next to the cell Click on this to display a menu of options. Help on this error does what it says, while the next option will be Show Calcu- lation Steps… if the cell contains the error, or Trace Error if the error has propagated
  • 94. 92 Step 6—Preparing and printing data from another cell.5. To demonstrate the error tracing feature, click in the Cheapest cell for euros, then click on the button and select Trace Error. Excel displays the source of the error, as shown below: You will see, if you are trying this yourself, that the arrow from the Eggs total to the Cheapest cell is red. Excel uses red arrows to denote the cell or cells that cause the error. The arrow from the Pounds cell is blue, and indicates that the Pounds value is an input to the cell with the error (remember, it’s multiplied by the Euros per Pound value on the second worksheet). The black arrow with the is there to warn you that the Euros value with the error is used in another worksheet—it’s used in the bar chart in the Chart1 worksheet. If you select this now, you’ll see that the offending value is rep- resented as zero in the bar chart.I think you’ll agree that Excel’s error auditing is pretty neat. For worksheets of anycomplexity, it’s a life-saver. Next we’ll demonstrate how to batch check for errors. Leavethe deliberate divide by zero error in the Eggs (Euros) cell, and try this:1. Select Tools ➪ Error Checking… Excel displays the Error Checking dialog: Figure 6.1 Excel’s error checking dialog The buttons in this dialog perform similar functions to the menu options displayed
  • 95. Preparing a worksheet for printing 93 when you click on a button for a cell with an error. The second button’s legend changes from Show Calculation Steps… for a cell that contains an error, to Trace Error for a cell that contains an error propagated from another cell. Try some of the options.2. Click on Next to proceed to the next error. Note that Excel ‘visits’ each cell that contains an error, whether the error is contained in the cell, or propagated from another cell.3. When you have visited all the cells that contain errors, Excel displays the following dialog: Figure 6.2 No more errors It also displays this dialog if you select Tools ➪ Error Checking… in a worksheet that does not have any errors.When you have finished these exercises, close your shopping list worksheet, discarding thechanges.Checking spellingExcel’s spell checking is similar to Word’s. The main differences are in the options available,and the fact that you can select an area of a worksheet and have Excel spell-check only theselected area.To see how this works, try this:1. Reopen the shopping list worksheet.2. First, set the language option. Choose Tools ➪ Options…, click on Spelling and select the required language, for example English (U.K.).3. Change Eggs to some non-word, such as ‘Grubble’.4. Select Tools ➪ Spelling… Excel stops at the first spelling error with the dialog shown in Figure 6.3.
  • 96. 94 Step 6—Preparing and printing data Figure 6.3 Excel’s spell checking dialogThe options here are the same as for Word’s spell checking:Ignore once This allows you to skip the error that is currently highlighted.Ignore all This allows you to skip all occurrences of the error that is currently highlighted. This is useful, for example, for any word that occurs frequently but which will not be in Excel’s spelling dictionary, such as a person or place name.Add to dictionary This allows you to add the highlighted word to Excel’s spelling dictionary. This stops the word from being flagged as a spelling error in future. Only do this for words you are sure are correct!Change This applies the selected change option to the highlighted word in your worksheet.Change all This applies the selected change option to all other occurrences of the highlighted word in your worksheet.AutoCorrect This creates an autocorrect entry for Excel that will in future change the incorrect word to the word currently highlighted under Suggestions. This encourages careless typing!Options… Displays the spelling options. This is equivalent to selecting Tools ➪ Options ➪ Spelling.5. Select the relevant option. Continue until Excel finds no further errors.
  • 97. Preparing a worksheet for printing 95Setting the print areaWhen you work with a Word document, you Notetypically either want to print all of it, or onlycertain pages. Excel has no concept of pages until Setting the print area is optional. Ifyou format a worksheet for printing, and will you do not set a print area, Excel willhappily print hundreds of blank sheets if you print the entire worksheet oraren’t careful. Fortunately it allow you to print workbook, as you specify.only part of a worksheet. You do this by definingthe print area. This specifies which part of aworksheet will be output when you print that worksheet. A print area setting remains inforce in a worksheet until you change it.Here’s an exercise to show how to set up a print area:1. Using your shopping list workbook, select Sheet1 and then File ➪ Print Preview. Excel displays the worksheet as it would appear on the currently selected paper size. Note the useful range of buttons to allow you to access all the other printing options from the preview screen.2. Click on Close to close the Print Preview.3. Click and drag to select just the title Shopping List and the table of items below it— omit the totals and other data.4. Select File ➪ Print Area ➪ Set Print Area. Excel places a dotted line around the print area.5. Select File ➪ Print Preview again. As you can see, Excel will now print only the area you have marked as the print area.There is no concept of multiple print areas in NoteExcel. That is, you cannot Ctrl-click to select twoor more areas of a worksheet and then set the Worksheets that contain only chartsprint area. If you do this, Excel merely uses the have no concept of a print area. If afirst area you selected as the print area. worksheet contains both data and one or more embedded charts, the chartsTo clear the print area, select File ➪ Print Area ➪ are printed if any part of themClear Print Area . You do not need to have any overlaps a print area, otherwise theyspecific group of cells selected when you do this. are omitted from printing.
  • 98. 96 Step 6—Preparing and printing dataSetting print marginsThe print margins dictate the amount of white space surrounding your worksheet whenprinted. Generally you will not need to change these, but it’s easy to do so:1. Select File ➪ Page Setup…2. Click on Margins.3. Use the widgets to set the margin sizes you need.4. Click in the vertical or horizontal Center on page boxes to activate these options if you wish.5. Click on OK.You can also set the margins interactively by selecting File ➪ Print Preview, clicking on theMargins button and dragging the margins to the desired locations.Adding headers and footersExcel provides you with a wide range of data that can be included in headers and footerswhen you print a worksheet or workbook. In the following exercise, we’ll add the filenameof the worksheet as a header, and page numbers and a date as footers:1. Using your shopping list worksheet, select Sheet1.2. Select File ➪ Page Setup… and then select Header/Footer. The pull-down menu for the Header field provides you with a collection of useful predefined headers. However, we will use the custom header and footer feature, so…3. Click on Custom Header… Excel displays the Header dialog. This Note contains a left, centre and right section that correspond to what you want to print at the Excel has no concept of mirrored left- top left, top centre and top right of the page. right pages, as Word does. The dialog is equipped with buttons that allow you to insert data in the header and format it. The buttons have the following functions: Allows you to set the text font Inserts the full file and folder and size for any header data. path. Inserts the current page number. Inserts the file name. Inserts the total number of Inserts the worksheet name. pages. Inserts the date. Inserts a graphic.
  • 99. Preparing a worksheet for printing 97 Inserts the time. Allows you to format an inserted graphic for size, scaling and cropping. Here we want to add the filename only in the header, so…4. Click in the field titled Center section, then click on the button. Excel adds the text &[File] to the centre header field.5. We decide that we want our headers in Arial Bold, so double-click on &[File] to select it, then click on the button. Excel opens the Font dialog. Select Arial under Font and Bold under Font style. Click on OK.6. Click OK again to close the Header dialog.7. Click on Custom Footer… Excel displays the Footer dialog. This is identical to the Header dialog.8. Click in the Left section field, then on the button to add the page number.9. Click in the Right section field, then on the button to add the date.10. Repeat step 5 to set both the page number and the date in Arial Bold.11. Click on OK to close the Footer dialog.12. Click on Print Preview in the Page Setup dialog to see the effect.When you have finished, click Close to close the page preview and save your workbook.Adding page breaksIt may happen for larger worksheets that even after setting a print area, some of your datafalls across page breaks. To deal with this problem, Excel allows you to add forced pagebreaks in the same way as Word.To set a forced page break:1. Select any cell in the first column of the row you want to be at the top of the page (or select the whole row).2. Select Insert ➪ Page Break. Excel adds a page break immediately above the selected cell.To remove a page break, select a cell or the row below the page break, then select Insert ➪Remove Page Break (no, we don’t think it’s very logical either). If you cannot find this menuoption, you have the wrong cell or group of cells selected.Excel allows lateral as well as vertical page breaks. If you select a cell that’s not in the firstcolumn, then select Insert ➪ Page Break, Excel inserts page breaks at the row above theselected cell and in the column to the left of it. This might be a little tricky to grasp, so
  • 100. 98 Step 6—Preparing and printing datahere’s a simple exercise to illustrate it (omit the first two steps if you already have this printarea selected from the previous exercise):1. Using your shopping list worksheet, click and drag to select just the title Shopping List and the table of items below it—omit the totals and other data.2. Select File ➪ Print Area ➪ Set Print Area. Excel places a dotted line around the print area.3. Click to select the cell containing the Pounds total.4. Select Insert ➪ Page Break. Notice now that you have a horizontal page break above the row containing the selected cell, and also a vertical page break to its left.5. Select File ➪ Print Preview to see the effect.It’s not terribly helpful here, but this ability is a Warninglife-saver when formatting large worksheets forprinting. To clear a combined page break suchFinally, Excel has a useful page break view, as this, you must select the same cell at the intersection of the breaks as youaccessible by selecting View ➪ Page Break used to set them, otherwise you willPreview. In this view, you can click and drag page clear only the horizontal or the verticalbreaks. Right-clicking on a cell in the Page Break page break, not both.Preview provides several useful commands:■ Insert page break■ Remove page break■ Reset all page breaksas well as several print area commands. Experiment with it now to see how it works.Setting printing optionsThe last step before printing is to set the remaining printing options. These are done fromthe Page Setup dialog.Setting repeating titlesIf you have a table, for example, that requires more than one page, it’s useful to be able torepeat the titles on all pages. Alternatively, you can instruct Excel to repeat a column onevery page. To do this:1. Select File ➪ Page Setup… and click on Sheet.2. Click on the button to the right of the Rows to repeat at top or Column to repeat at left fields.3. Select the row or column to repeat in the worksheet.
  • 101. Preparing a worksheet for printing 994. Click on the button to return to the Page Setup dialog.5. Click on Print Preview to see the results.6. Click on OK to confirm.By default Excel does not print gridlines or row and column headers. In this dialog, you cantell Excel to print them if you need to.The Cell errors as field allows you to select how any remaining errors are printed. The Pageorder options control how worksheets that are wider than the paper are printed.Setting the page orientation, scaling and print qualityThe Page pane of the Page Setup dialog is where you set the page orientation, scaling andpaper size. Alter selecting File ➪ Page Setup…, select the required orientation:Next, select the scaling options. You have the choice of setting a scaling percentage usingthe Adjust to option, or of letting Excel scale the worksheet automatically to fit the paperwith the Fit to option.
  • 102. 100 Step 6—Preparing and printing dataUnfortunately, the zoom option offered by Warningsetting Adjust to to a value of greater than 100%also enlarges any headers and footers you might Be careful when using Fit to. Alwayshave defined. This may not be what you want. check for results with Print Preview before printing—you may find thatIf you set a value greater than 1 for the Fit to… you have to return and reset the printpages wide setting, you need to pay attention to area (see page 95) to avoid printing athe Page order setting to determine how your large number of blank pages.pages are printed.The Paper size field allows you to select the paper for the printer currently selected. Thechoices here will depend on the printer—some printers can be loaded with more than onepaper size.Some printers also offer variable print quality. For example, most inkjet printers offer a‘draft’ quality that is faster and uses less ink. Some laser printers offer similar functions,although these are normally expressed as dots per inch (dpi). 300 dpi is generally acceptedas the minimum quality for laser printers, 600 dpi is the normal setting for office work. Afew printers may offer higher resolutions where quality is important. The Print quality fieldallows you to select from the available options, if they are present.Printing a worksheet or workbookWhen you have satisfied yourself that you’ve set all the printing options as you wish,selecting File ➪ Print displays the Print dialog (Figure 6.4). Figure 6.4 Excel’s print dialog
  • 103. Printing a worksheet or workbook 101This is very similar to Word’s Print dialog. The options have the following functions:Name Allows you to select printers other than the printer currently defined as your default printer.Properties… Allows you to set printer-specific functions, such as selecting a special paper tray, or printing thumbnails.Print range All prints all pages required by the Print what setting. You can select a different range of pages using the From and To fields.Print what Allows you to select whether to print the entire workbook, the currently-selected worksheets, or a selected area on a worksheet. You can print more than one worksheet by selecting the first worksheet, then holding down the Shift key while selecting subsequent worksheets.Copies Allows you to set how many copies should be printed. The Collate option ensures that pages are printed in sequence if you are printing multiple copies of a worksheet or workbook that require more than one page when printed.Print to file This allows you to output the print image to a file as PostScript.Print what needs some explanation. Here’s how to print all the options available:To print this Do thisPart of a worksheet Select the area to be printed, select File ➪ Print, select Selection under Print what.An entire worksheet Display the worksheet, select File ➪ Print, select Active sheet(s) under Print what.Selected worksheets Shift-click on the worksheet tabs to select the worksheets to be printed, select File ➪ Print, select Active sheet(s) under Print what.An entire workbook Select File ➪ Print, select Entire workbook under Print what.
  • 104. 102 Step 6—Preparing and printing dataSaving Excel data using different file typesWe’re almost through with Excel, but there’s Warningone final thing you need to know. When yousaved your first Excel workbook in Step 1, you Some alternative file types are notsaw that the Save As dialog had a Save as type capable of saving all the informationfield, the default for which was Microsoft Excel in an Excel workbook. If this is theWorkbook. There are a number of other file types case, Excel warns you when you save athat you can use to save data from an Excel workbook as one of these file types, asworkbook, and you need to be aware of the shown in Figure 6.5. You should alsopurpose of these. The more important of these be aware that Excel itself cannot openare listed in this section. When you save all or some of the file types described here.part of a workbook as one of these file types,Excel automatically adds the correct name extension to identify the file type. Be aware thatthe term ‘file format’ is also used for file types. Figure 6.5 An Excel save warning for alternative file typesTemplatesWhen you save an Excel workbook as a template, everything in the workbook is saved, butthere are two key differences when compared to saving as a workbook:■ Excel automatically selects your Templates folder as the default location where the file is to be saved. This is the folder that Excel looks in if you select the General Templates… option from the task pane that is displayed when you select File ➪ New…■ Excel saves the workbook in its template format. This preserves all the information in the workbook, but changes the name of any new workbooks created from the template, by adding a digit after it. Thus, for example, if you save a workbook as a template with the name Shopping List, Excel would name new workbooks created from the template as Shopping List1, Shopping List2, Shopping List3, and so on.Templates are extremely useful for any workbook that you are intending to use many timeswith different data.
  • 105. Saving Excel data using different file types 103Text formatsExcel’s text file types allow you to save numerical data from a workbook in a form thatallows it to be used in other programs such as Word. Excel has two main text file types:■ Tab-delimited. This file type saves the numerical information as a set of values separated by tab characters.■ CSV. This is shorthand for ‘comma separated value’, from which you can guess that the individual numerical values are separated by commas when a worksheet is saved as this file type. CSV is a widely supported standard for transferring data between different applications and different computer systems.Both file types save only numerical data, not formulae or formatting, and only save theinformation contained in the active worksheet. Figure 6.6, for example, shows what ourshopping list example looks like in the two text formats when displayed in the Notepad texteditor, with the CSV version in front. Figure 6.6 The shopping list example in text formatsWeb page, Web archiveAs their name suggests, these file types store data in a form that can be read by a Webbrowser. This is HTML, which stands for Hypertext Markup Language. The Web Page filetype gives you the option of saving the active worksheet or an entire workbook. WebArchive is a special file type that allows a workbook to be saved in its entirety, completewith graphics, so that it appears as a complete Web site in a browser. This is illustrated inFigure 6.7.
  • 106. 104 Step 6—Preparing and printing data Figure 6.7 The shopping list example as a Web archive, viewed in Explorer Previous versions of Excel From time to time complex applications like Excel have to change their default file type (workbook) to accommodate new features in the application. If you need to transfer a workbook to a computer, or a client, that uses an older version of Excel, you can still save workbooks in file types that are compatible with these older versions. The relevant file types are Excel 5.0/95, Excel 97-2002/95 , Excel 4.0, Excel 3.0 and Excel 2.1. Other applications As well as the file types we’ve already described, Excel can save your workbook in files of types designed to be opened by other, non-Microsoft, applications. These file types include several that can be opened by Lotus 1-2-3, a spreadsheet application from IBM, Quattro Pro, a spreadsheet application from Borland Software Corporation, and dBase, a database application. And finally… Congratulations—you’ve completed the steps on Excel. But don’t forget to run through theDone! quiz on page 106.
  • 107. Saving Excel data using different file types 105ReviewIn this step, you learned:■ The correctness of calculations is up to you!■ Excel offers a clever method for tracking down maths errors.■ Excel has a spelling checker.■ You need to tell Excel what to print, by defining a print area.■ If a worksheet’s contents occupy less than a page, you can centre the contents on the page.■ You can define headers and footers for a worksheet, which are placed on every page printed from that worksheet.■ Headers and footers can contain automatic data such as page number, time, date, the workbook’s filename.■ You can add forced page breaks in a worksheet to improve the presentation of the worksheet on paper.■ You can force Excel to repeat a title row on every page of a printout.■ You can scale a worksheet manually or automatically to make it fit a specific paper size for printing.■ Using printing options, you can print: – Part of a worksheet – An entire worksheet – Selected worksheets – An entire workbook.■ Excel offers a variety of alternative file types that you can use to save a workbook or worksheet for different purposes and different application programs.
  • 108. 106 Step 6—Preparing and printing dataQuiz1. There are three critical things you should check before printing a worksheet for distribution to others. What are they?2. What is the purpose of the button that is sometimes displayed next to a cell?3. What does the icon indicate when Excel is displaying an error audit?4. When checking spelling, you click AutoCorrect for an unknown word. What is the effect of this?5. What is the purpose of the print area setting?6. What does the button do when used in a header or footer?7. What would you do if you wanted the headers or footers in a worksheet to be printed in a different font to the rest of the worksheet?8. What would you select in a worksheet if you wanted to clear a page break set on a row?9. You are working on a very wide worksheet (that is, it uses many columns of data). What printing options might you use?10. You have a worksheet that contains some data and an embedded chart. You want Excel to print both the data and the chart. What settings would you choose for: – Print area – Print what in the Print dialog?
  • 109. GlossaryAbsolute reference A cell reference that does not change even if the cell contain- ing the reference is moved or copied. Absolute references can refer to row, column, or both, and are denoted by placing a ‘$’ sign before the relevant reference. For example, ‘$C2’ makes the column reference absolute, ‘C$2’ makes the row refer- ence absolute, and ‘$C$2’ makes both row and column refer- ence absolute.Application program Any computer program that processes data. Application programs include productivity software such as spreadsheets, word processors, database management systems, as well as special-purpose applications such as accounting, payroll, billing, inventory, computer-aided design, manufacturing control and others.Auto-fill A feature that allows additional cells to be filled with data or formulae based on a pattern of selected cells. For example, selecting cells containing the values ‘1’ and ‘2’, and then dragging, causes Excel to fill the new cells with integers whose value increases by 1 for each additional cell.Bit Short for ‘binary digit’, the basic unit of information in digital computer systems. A single bit can have the values 0 or 1.
  • 110. 108 GlossaryCell protection A feature that allows the contents of cells to be temporarily made read-only.Central processing unit The part of a computer system that interprets and executes the instructions contained in the software.Chart A feature that allows numerical data to be displayed graphi- cally. Excel offers many chart types, including column, bar, line, pie and more complex types.Computer A general-purpose machine that processes data according to a set of stored instructions in the form of an operating system and application programs.Computer-aided design The use of application programs to create dimensioned drawings, specifications, parts lists, and other design-related elements.Cursor An indicator in an application program that marks the active point in a document or other data object, usually the point at which new data can be inserted as text or a graphical object.Data Information represented in a form suitable for processing by computer.Data point A single item of data in a data series.Data series A set of related data points.Database A set of files in a computer that store a set of related data such that a program can consult it to answer questions. Databases are created and managed by a database management system.Database management Software that allows the modelling, storage and retrieval ofsystem data in a database, as well as ensuring its security and integ- rity. Often referred to as a DBMS.Dependent (cell) In Excel, a cell whose displayed value is dependent on the data stored in another cell.
  • 111. Glossary 109Embedded chart A chart that is contained within an Excel worksheet that also contains data, rather than occupying a worksheet of its own, or a chart embedded in a Word document.File A collection of computer data held on a storage medium in a defined format. For example, a Word document, an Excel workbook, or a PowerPoint presentation.Folder A virtual container used to hold files within a computer’s file system.Function A built-in operator that computes and displays a mathemati- cal value based on the data held in one or more cells.Graph A way of displaying numerical data with more than one dimension by plotting on as many axes as there are dimensions to the data.Graphical user interface A computer operating system or application that allows data to be displayed and manipulated using windows and a mouse. See also WIMP.Hardware The term used to describe physical computing devices such as the processor, monitor, keyboard, mouse and so on. Contrast with software.HTML Hypertext markup language, the language used to encode the contents of Web pages.Hyperlink An active reference in a hypertext document that, when clicked, transfers the viewer to the destination of the refer- ence.Hypertext A form of displaying information in which hyperlinks allow other documents or resources to be referenced in whatever order the viewer chooses.Icon In the context of computer software, a small, often clickable graphic that is used to represent a file, folder, disk or other computer resource.
  • 112. 110 GlossaryInkjet A type of printer technology in which tiny drops of ink are sprayed onto the paper to form an image.Instruction An item of information from a computer program that the central processing unit interprets as a command to act on data, rather than an item of data itself. Both instructions and data are composed of bits.Laser printer A type of high-quality printer that forms images on paper by depositing a powdered ink using electrostatic charges placed on the paper by a low-powered laser. Laser printers commonly feature a high printing resolution, and may be monochrome or colour.Mantissa, exponent The two parts of a number when it is expressed in scientific notation. The mantissa contains the significant digits of the number in the range 0–9, and the exponent contains the power of ten to be applied to the mantissa. For example, 12.25 is ‘1.225E1’ in scientific notation, while 1001 is ‘1.001E3’.Menu The part of a graphical user interface that is used to select commands using a mouse. Menus can be pull-down, extend- ing from the top of a window when clicked, or pop-up, appearing at the mouse cursor position when clicked.Modifier key A non-alphanumeric key that is used to perform special functions when pressed at the same time as an alphanumeric key. Windows computers use the Ctrl (Control) and Alt (Alternate Function) keys as modifier keys.Monitor The computer peripheral used to show information generated by a computer.Name extension The part of a file name following the ‘.’ that is used to identify the file’s type. For example, ‘.doc’ (Word document), ‘.xls’ (Excel workbook), ‘.txt’ (plain text file).Operating system The software responsible for the direct control and manage- ment of a computer’s hardware and system operations, as well as providing a means of running application software.
  • 113. Glossary 111Peripheral Any computer hardware that is attached to the system unit to extend its abilities. For example, keyboard, mouse, monitor, external hard drive, scanner, printer.PostScript A page description language developed by Adobe Systems to allow high-quality printing on any printer equipped with the required software to decode it. Most modern laser printers use the PostScript language.Print area The area in an Excel worksheet that is designated for printing. This can be less than the whole worksheet.Program The sequence of stored instructions that is interpreted and executed by a computer in order to perform some useful task. See also application program.Series (data) See data series.Shortcut key A key combination, typically including a modifier key, that performs a specific function in an application program, such as selecting a menu command. Shortcuts keys are designed to provide experienced users with a quicker alternative to select- ing commands with the mouse.Software A term generally used for any computer program, to distin- guish it from hardware.Spreadsheet In the context of software, an application program that consists of one or more grids of cells, each of which can contain data or formulae that display the results of calcula- tions based on the value of data in other cells. See also workbook, worksheet.Taskbar (Windows) The bar along the lower edge of the screen in Windows operating systems, used for storing and selecting individual windows.Thumbnail (printing) Scaled down images of a document’s pages, often created to check for text flow through the document’s pages.
  • 114. 112 GlossaryWIMP An acronym standing for ‘window icon menu pointer’, the design basis of modern graphical user interfaces for operating systems and application programs.Word processor An application designed to allow the creation, editing and printing of documents, usually both text and graphics.Workbook An Excel file consisting of one of more worksheets.Worksheet An individual Excel spreadsheet within a workbook.
  • 115. IndexA Central processing unit 108Absolute reference 47, 107 Chart 108, 109Application program 107, 111 adding legends in Excel 80Auto-fill, in Excel 33, 107 adding to Word documents 86AVERAGE function 45 changing type in Excel 83 copying in Excel 85B creating simple in Excel 77Background, setting in Excel 62 editing data range in Excel 84Bit 107 editing in Excel 81Book in Excel 75 overview v moving in Excel 85 text features vi other types in Excel 79Border, on cells in Excel 65 Chart Wizard 77, 79, 80Browser 103 Clearing cell in Excel 31 Colour, setting in Excel 62C ColumnCell deleting in Excel 32 absolute reference 47 inserting in Excel 32 borders in Excel 65 locking in Excel 8 clearing 31 selecting in Excel 24 deleting 31, 32 Comment, adding to cell 30 dependent 29, 108 Computer 108 inserting 32 Computer-aided design 108 locking, protection in Excel 69 Conventions vi mixed references 49 Copying protection 69, 108 chart in Excel 85 relative reference 47 data in Excel 24–29 selecting in Excel 24 worksheet in Excel 12Cell reference, changes in copy or move 28 COUNT function 45
  • 116. 114 IndexCreating adding comments to cells 30 other chart types in Excel 79 adding document details 16 simple chart in Excel 77 adding headers and footers 96Cursor 108 adding new worksheet 10Customising adding page breaks 97 Excel 13 auto-fill 33, 107 AVERAGE function 45D calculating, displaying percentages 59Data 108 cell borders 65 defining formats in Excel 60 cell locking, protection 69 display formats in Excel 55 cell references in copy or move 28 editing chart range in Excel 84 changing chart type 83 editing in cells 23, 30 charts, graphs 75 interpretation in Excel 21 checking for errors 91 moving and copying in Excel 24–29 checking spelling 93 non-adjacent in Excel 26 clearing, deleting cells 31 number formats in Excel 57 compatibility with older versions 104 search, replace in Excel 34 compatibility with other applications 104 sorting in Excel 36 conditional references 50Data point 77, 108 controlling recalculation 14Data series 23, 77, 84, 108 copying data between workbooks 27Database 108 copying worksheet 12 functions in Excel 42 copying, moving charts 85Database management system 108 COUNT function 45DBMS, see Database management system creating automatic series 33Default printer 101 creating formulae 43Deleting creating other chart types 79 cell 31, 32 creating simple chart 77 worksheet in Excel 12 customising 13Dependent cell 29, 108 data point 77, 108#DIV/0! error message 50 data series 23, 77, 84, 108Document defining data formats 60 setting default location in Excel 14 deleting cell, row, column 32 deleting worksheet 12E dependent cell 29, 108Editing displaying text 61 cell data in Excel 23 displaying toolbars 15 chart data range in Excel 84 editing cell data 23 charts, graphs in Excel 81 editing chart data range 84Embedded chart 79, 87 editing charts, graphs 81 in Excel 95, 109 editing data in cells 30Error enabling toolbars 7 checking in Excel 91 error messages 49 messages in Excel 49 file types 10Excel 1–104 formulae 41 absolute reference 47, 107 function 4, 42, 45, 109 adding chart, graph legends 80 getting help 17
  • 117. Index 115 graph 4, 109 Exponent 22, 110 how input is interpreted 21 inserting cell, row, column 32 F locking row, column 8 File 109 MAX function 45 saving as different type in Excel 102 MIN function 45 types in Excel 10 mixed references 49 Folder 109 moving data between workbooks 27 Font moving, copying data 24–29 serif 61 non-adjacent data 26 setting style in Excel 61 number formats 57 Footer 5 opening, saving workbooks 9 adding in Excel 96 order of processing formulae 46 Formula preparing worksheet for printing 90 checking for errors 91 printing 89–104 creating in Excel 43 printing worksheet, workbook 100 in Excel 41 protecting worksheet contents 67 order of processing in Excel 46 relative reference 47 Function 4, 109 renaming worksheet 11 conditional 50 saving as Web page 103 in Excel 42, 45 saving to different file type 102 saving to text format 103 G search, replace data 34 Graph selecting cell, column, row 24 adding legends in Excel 80 setting colour, background 62 editing in Excel 81 setting default document location 14 in Excel 4, 75, 109 setting display formats 55 Graphical user interface 109 setting font style 61 setting menu length 13 H setting print area 95 Hardware 109 setting print margin 96 ##### error message 50 setting printing options 98 Header setting toolbars defaults 15 adding in Excel 96 setting up titles 98 Help shortcut keys 17 in Excel 17 sorting data 36 HTML 103, 109 text wrapping, alignment 63 Hyperlink 109 toolbars 14, 15 Hypertext 109 undoing changes 32 user interface 5 I using different views 7 Inkjet 100, 110 using templates 102 Inserting cell 32 working with worksheets 10 Instruction 110
  • 118. 116 IndexL ReferenceLaser printer 100, 110 absolute in Excel 47Legend, adding to chart, graph in Excel 80 conditional in Excel 50Locking row, column in Excel 8 mixed in Excel 49 relative in Excel 47M RenamingMantissa 22, 110 worksheet in Excel 11MAX function 45 RowMenu 110 deleting in Excel 32 setting length in Excel 13 inserting in Excel 32MIN function 45 locking in Excel 8Modifier key 17, 110 selecting in Excel 24Monitor 79, 110Moving S chart in Excel 85 Saving data in Excel 24–29 different file type in Excel 102 workbook in Excel 9N Searching#NAME? error message 50 for data in Excel 34Name extension 102, 110 Selecting cell, column, row in Excel 24#NUM! error message 50 Series, creating automatic in Excel 33 Serif font 61O Shortcut key 111Operating system 110 in Excel 17 Software 111P SortingPage break, in Excel 97 data in Excel 36Password 70 SpellingPercentage, using in Excel 59 checking in Excel 93Peripheral 111 Spreadsheet 1–104, 111PostScript 101, 111 description 1Print area 97, 98, 100, 111 Style setting in Excel 95 fonts in Excel 61Print margin, setting in Excel 96Printer T inkjet 100, 110 Taskbar 27, 111 laser 100, 110 Template, in Excel 102Printing Text Excel workbooks 90 alignment, wrapping in Excel 63 in Excel 89–104 display formats in Excel 61 setting options in Excel 98 Thumbnail 101, 111 worksheet, workbook 100 Title, setting in Excel 98Program 111 Toolbar customising in Excel 14, 15R displaying in Excel 15Recalculation, controlling in Excel 14 enabling in Excel 7#REF! error message 50 setting defaults in Excel 15
  • 119. Index 117U WordUndoing adding Excel charts 86 in Excel 32 Word processor 112User interface Workbook 4, 6, 10, 12, 16, 27, 112 Excel 5 adding document details 16 and worksheet 4V opening, saving 9#VALUE! error message 50 printing 90, 100View saving as different file type 102 in Excel 7 Worksheet 4, 7, 8, 112 adding new 10W and workbook 4Warnings in text vi copying 12Web deleting 12 saving data from Excel 103 preparing for printing 90Web browser 103 protecting contents 67WIMP 112 renaming 11Wizard 77, 79, 80 working with 10