SlideShare a Scribd company logo
1 of 124
Download to read offline
Guide to Excel
Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
1 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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17
2 Working with spreadsheet data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21
How Excel interprets data entries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21
Editing cell data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23
Searching for data, replacing data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34
Sorting data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36
3 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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50
4 Improving a sheet’s appearance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55
Setting display formats for data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55
Setting display formats for text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61
Using cell borders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65
Contents
iv
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
Preface
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 you
have 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 Microsoft
Windows XP on which a copy of Microsoft Office XP Professional or Microsoft Excel 2002
has been installed.
Overview
We have tried to design the steps so that many of them can be completed in a minimum of
about 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 up
the appearance of a spreadsheet, for example for a presentation, working with charts and
graphs, and finally preparing and printing spreadsheet data.
T
Preface
vi
Layout and features
You shouldn’t try to get through all the steps
without a break. After each step there are
questions you can use to check your knowledge
and to practise what you have learned.
The book also gives you signposts to help you
keep track of your progress and to highlight
interesting or important points. To allow you to
chart your progress, you’ll find icons like this in
the margin to show you how far you have
progressed through each step.
We also use the panels shown on the right to
highlight special or important pieces of
information.
Conventions used in the steps
Apart from the graphics mentioned above, the
following 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.
Note
It’s important to remember this.
Tip
This can make your life easier.
Warning
Be aware of this.
Stop!
Don’t do this.
S T E P
1
Getting started
with Excel
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 with
spreadsheet 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 working
with numbers—although not only numbers.
Why would you want to do that? There are few aspects of business that don’t involve
working 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, estimation
and so on in the work of most businesses. This is where spreadsheets excel (no pun
intended).
The term ‘spreadsheet’ comes from traditional accounting practice. It was used to describe
the format used in book-keeping ledgers, in which expenditure categories were arranged as
Checklist
■ Introduction to spreadsheets
■ Excel’s basic user controls
■ Creating, opening and saving workbooks
■ Working with worksheets
■ Customising Excel
■ Getting help
T
Step 1—Getting started with Excel
2
columns, and amounts were added in the relevant columns, with each row representing a
transaction. 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 see
something like Figure 1.1. Do it now using Start ➪ All Programs ➪ Microsoft Excel. It
looks a bit like a table, and that’s a useful way of thinking about it.
Look at the blank document on your screen. As you can see, it is divided into cells, each of
which 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.
Figure 1.1 A blank Excel document
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 in
other cells. This means that once you have defined your formula, merely changing the
numbers 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 Excel
document. 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?
Step 1—Getting started with Excel
4
Let’s explain what’s going on here. Entering ‘=’ as the first item in a cell tells Excel that you
want 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 including
cells C5 and C8, that is:
C5 + C6 + C7 + C8
and display the result in the cell that contains the function. We will go into more detail
about functions in Step 3.
You may still be wondering what all the fuss is about. But now go back to your shopping list
and try entering different values for the costs of individual items. Can you see that the total
updates itself automatically? Now imagine a large sheet with much more complex
calculations and many more totals—change any input information, and all the calculations
are updated automatically, just as with this simple total. Now imagine the results plotted on
a graph within the spreadsheet, and seeing that updated automatically. That is where the
power of a spreadsheet program lies.
That, in essence, is what spreadsheets are all about—ensuring that calculations of almost any
complexity only have to be defined once, but can be repeated endlessly just by entering new
numbers.
Keep your shopping list open, as we’ll use it again shortly.
Some clarity and some confusion
So far we’ve been referring to Excel as a ‘spreadsheet’, or ‘spreadsheet program’. This is
because ‘spreadsheet’ is the term in common use. In fact the term Excel itself uses is
worksheet, usually shortened to sheet. A new Excel document, by default, contains three
worksheets—for no particular reason other than it’s more than two and less than four—and
the entire document is referred to as a workbook. These are the terms we will use from now
on.
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 multiple
worksheets 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’s
for later.
A trip around the interface 5
A trip around the interface
Figure 1.2 shows a labelled version of Figure 1.1, and below we’ll explain the purpose of the
major controls. This time we’ve re-enabled the task pane using View ➪ Task Pane.
Travelling 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
The formatting toolbar
Task pane
Column titles
Row titles
Cell selector
Formula bar
The standard toolbar
More tools hiding here… …and here
Help
Horizontal scroll bar
(obscured by task pane)
Worksheet tabs
Menu bar
Worksheet selector widgets
Vertical scroll bar
(obscured by task pane)
Figure 1.2 Excel’s user interface
Step 1—Getting started with Excel
6
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!
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
A trip around the interface 7
As with your work with Word, this may seem a lot to remember. Don’t worry—it will
become more familiar as you work with the application.
Enabling and disabling toolbars
Excel has twenty-nine toolbars, most of which are for special purposes. Those that you will
probably find most useful initially are the Standard, Formatting, Tables and Borders and
Drawing 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 suit
the way in which you want to work with Excel. There’s more about toolbars later in this
step.
Using different views
Excel allows you to use zooming to change the magnification of your worksheet in much the
same way as Word does with documents. The zoom/magnification setting applies to the
current 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.
Step 1—Getting started with Excel
8
Full screen viewing is useful when you are
working with large worksheets, or if you are
working only in Excel.
4. Now select File ➪ New and click on Blank
workbook in the task pane to open a new
blank workbook.
5. Select the Window menu. Note that Excel
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
icon in the workbook window—not the
entire application’s close icon.
Locking rows and columns
Much of the work you will do in Excel consists of
handling tables of information. If you use a row
at the top of a worksheet for titles, it’s really useful to be able to keep that on screen while
scrolling 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 row
remains locked on screen. Remember:
To unfreeze panes, select Window ➪ Unfreeze Panes.
To lock a row Select the row below the row you want to lock, then select Window
➪ Freeze Panes
To lock a column Select the column to the right of the column you want to lock, then
select Window ➪ Freeze Panes
Tip
A quick way to scroll around a
worksheet is to click in a cell near the
top, bottom or side of the sheet and
drag in the direction you want to
scroll. Excel moves the hidden cells
into view as you do so.
Warning
Note that Excel has two Close icons,
one for the foreground workbook, and
one for the entire application window.
Don’t confuse them.
Opening, saving, closing, reopening 9
Opening, saving, closing, reopening
If you worked through the steps on Microsoft Word, you’ll be familiar with the operations
of 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’.
2. 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 the
workbook without requesting a name (it already has one). If you want to save a copy of the
workbook under another name, select File ➪ Save As… This displays the dialog shown in
Figure 1.3 again, allowing you to supply a new name for the copy of the document.
Figure 1.3 Excel’s Save As dialog
Step 1—Getting started with Excel
10
Excel’s alternative file types
Excel offers a variety of alternative file types in addition to Workbook. Other file types
include Web page format and text. You need to know about several of these. For the
moment, be aware of the fact that there is a Save as type field in the Save As dialog—we will
return to alternative file types in Step 6.
The alternative format that is likely to be most
useful to you is Template.
Working with worksheets
You have already seen how a default workbook
contains three worksheets. You might be
wondering at this stage why you would want
more than one worksheet. Here are a few things
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 your
shopping list example, or a blank worksheet—it’s up to you.
Adding a new worksheet
To 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. To
move 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.
Tip
Excel templates provide you with an
easy way to create new workbooks
with the same formatting and layout
as an original. If you are likely to want
to create several workbooks with the
same formulae and layout, it’s worth
saving the first one as a template.
Working with worksheets 11
3. Select (move to end) and click on OK.
Excel moves the selected worksheet to the end of the list of worksheets.
Renaming a worksheet
When 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.
Figure 1.4 Excel’s Insert dialog
Figure 1.5 The Move or Copy dialog
Step 1—Getting started with Excel
12
Deleting a worksheet
As 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 you
select it.
Click on Delete to delete the worksheet.
Copying a worksheet to another
workbook
To carry out this exercise, you first need to
create 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 the
foreground, 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. To
use the same procedure to copy a worksheet within a workbook, don’t make any selection
in the To book pop-up menu.
Figure 1.6 Deleting a non-empty worksheet
Warning
Once you click on Delete, the data that
the sheet contained is gone for good—
there is no Undo operation!
Bending Excel to your will 13
Bending Excel to your will
As with Microsoft Word, many features of Excel are customisable. This section lists a few
of the things you might want to change, and also gets you familiar with how to change
Excel’s many options. Many, but not all, of these options lurk behind the Tools ➪ Options
and Tools ➪ Customize commands. Take a look at what’s there while you follow the
following simple exercises.
Partial or full menus?
By default Excel only displays partial menus, which adapt to list the commands you use
most 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 in
the menu.
Figure 1.7 Worksheet after copying
Step 1—Getting started with Excel
14
Here’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 recalculation
By 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 when
you press the F9 key, rather than whenever you enter new data.
Setting the default location for documents
By default, Excel will offer you your My Documents folder in open and save dialogs. If this
is ok for you, you don’t need to change anything. If you decide that you want a different
default 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 toolbars
As with Word, Excel displays the Standard and Formatting toolbars by default. It displays
other toolbars in specific circumstances, such as the Drawing toolbar if you insert a drawing
into a worksheet. In Office XP Excel has twenty-nine toolbars, plus the menu bar, and on
Bending Excel to your will 15
top of that, you can create your own. Many of Excel’s toolbars are for special purposes, and
you are only likely to come across them if you start using Excel for complex mathematical
or financial work.
If you are a ‘visual’ person, someone who works easily with icons, toolbars will be useful to
you. Not everyone is, so you need to know how to control Excel’s toolbars so that you can
adapt it to match the way you want to work. The following sections are very similar to those
relating to Word’s toolbars, but we repeat them here so that you can refresh your
knowledge.
Displaying a toolbar
To display a concealed toolbar, select View ➪ Toolbars… and then select the toolbar you
want to display. The usefulness or otherwise of the various toolbars will become clearer as
you 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 defaults
If you find yourself working with the same toolbars all the time, you can tell Excel to display
them 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 time
you start up the application.
Customising a toolbar
To complete our discussion of toolbars, we’ll see how easy it is to add or remove commands
from 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.
Step 1—Getting started with Excel
16
■ To add back the default buttons, click on
the toolbar options widget and select Add
or Remove Buttons ➪ Standard, then reselect
the button you want to replace. (This
requires a bit of menu gymnastics!)
If you accidentally remove an entire menu, use
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 organised
into menus for you in the Commands list. Figure 1.8 shows a handy Clear menu added in this
way.
This method can be used with Word too, of course, as the handling of toolbars is identical
to Excel’s.
Adding document details
Excel saves extra information with worksheets in the same way that Word does with
documents—a worksheet’s title (not the same as its file name), subject, author, category
and 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.
Note
As Excel treats the menu bar as just
another toolbar, it’s possible to Alt-
drag an entire menu off the menu bar!
If you do this, you will need to use a
different method to replace the menu.
Figure 1.8 A new Excel menu
Shortcut keys 17
Try this now with your shopping list workbook:
1. Select File ➪ Properties. It’s quite likely that you’ll see something like Figure 1.9.
2. 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 keys
As an alternative to using the menu commands, Excel offers you shortcut keys. These are
key combinations, typically including a modifier key, that perform a specific function such
as selecting a menu command. See the table on the next page for the essential shortcut keys
you need to know in Excel.
Getting help on Excel
If you did not disable the Office Assistant when you worked through
the steps on Word, all you have to do to get help in Excel is to click
on it, popping up a dialog into which you can type your question.
If you disabled the Office Assistant, you can get the same results by
typing a question into the help field in the menu bar.
Figure 1.9 Document properties
Step 1—Getting started with Excel
18
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’s
dialogs also have contextual help, which you can access by clicking on the icon.
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.
Done!
Getting help on Excel 19
Review
In 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.
Quiz
1. 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.
S T E P
2
Working with
spreadsheet data
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 entries
Many computer applications have been described as ‘intelligent’, but Excel is one that has
some claim to this title. It adopts the approach that a tool designed to work with numbers
should be good at understanding numbers. For example, Excel applies a format
automatically 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
Checklist
■ Entering data into Excel
■ Editing data in cells
■ Searching for and replacing data
■ Moving and copying data between cells and worksheets
■ Sorting data
T
Step 2—Working with spreadsheet data
22
12e2 Return
12/12/04 Return
You should now see something like this:
Can you see what Excel has done? Here’s a step-by-step description:1
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
You entered What Excel did
12 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.
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.
Editing cell data 23
You should now see something like this:
Here’s what’s happened:
Excel has retained the formatting it applied automatically to these four cells. This may seem
confusing at first, but it allows Excel to process all numerical data internally in the most
efficient way, and display it in ways that make sense to us humans. We’ll return to
formatting in more detail in Step 4.
Editing cell data
Just as Excel tries to make it easy for you to insert data, it also tries to help with editing
data. In this section we’ll look at the ways you can move and copy data within and between
worksheets, and at how you can create an automatic data series.
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’.
Step 2—Working with spreadsheet data
24
Selecting cells, columns and rows
Before we look at how to edit, move and copy the data in cells, you need to know how to
select 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 dragging
Once you have selected a cell or group of cells in a worksheet, you can drag them wherever
you 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:
Editing cell data 25
4. 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 commands
Excel also has a pop-up menu that is displayed
whenever you right-click in a worksheet. Try this short
exercise 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.
Step 2—Working with spreadsheet data
26
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 data
To 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.
Editing cell data 27
6. 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, even
though the original data was not in adjacent columns.
Moving and copying data between worksheets and workbooks
Excel does not restrict you to working on one worksheet or workbook—you can work with
multiple worksheets at a time, and can open as many workbooks as you wish. You can do
this 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.
Step 2—Working with spreadsheet data
28
1. 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 have
to 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 menu
commands instead. When you have finished practising moving and copying data, close both
workbooks and discard the changes.
How Excel handles cell references when cells are copied or moved
The exercises above are all very well, but all we are moving is numbers. The power of Excel
comes from the fact that cells can contain formulae that reference the contents of other
cells.
You may be wondering what happens to such cell references when the cell containing a
formula is moved or copied. The answer is that Excel does what you normally want it to—
Editing cell data 29
it 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.
2. Click in cell A1 to select it.
3. Enter 12 Tab =A1.
This places the numerical value 12 in A1,
and the expression =A1 in B1. This just tells
Excel always to make the value displayed in
B1 equal to the value contained in A1. Cell
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 are
changed automatically by Excel to reference the same relative cells after the move or copy
operation. This is normally what you want to happen. If it’s not, you can prevent it—we’ll
go into more detail about this in Step 3.
Note
In step 3, note that the contents of B1
is the expression =A1, not 12. Cell B1
displays the value 12 because this is
the result of the expression =A1. This
may seem confusing until you become
more familiar with Excel.
Step 2—Working with spreadsheet data
30
Editing data in cells
As you have seen, you insert data in cells by clicking in the cell and typing the data. To edit
data already in a cell, click to select the cell and then edit the cell’s contents in the formula
bar.
When you click in the formula bar, Excel highlights any cells that are referenced by a
formula in the cell being edited, using colour to distinguish them, as the illustration above
shows (or would, if it were in colour). When you have made any changes you wish, the
button 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 click
on and drag any of the highlighted referenced cells. You do this by moving the mouse cursor
over the edge of the highlighted cell you want to move, then click and drag it to the new
location. Excel then adjusts the formula accordingly
Practise this now, using some simple formula such as the one shown in the illustration above.
Adding comments to cells
You can add comments to individual cells. Comments are useful, for example to explain a
formula, either for a colleague, or to remind yourself at a later date.
Editing cell data 31
To enter a comment in a cell, select the cell, then select Insert ➪ Comment. Excel opens a
window for your comment, titled with your name:
To close the comment window, just click outside it. After you have done so, Excel shows a
small red tag at the top-right corner of the commented cell. Moving the mouse pointer over
the cell causes the comment to be displayed:
To change or delete the comment, select the commented cell, right-click and select Edit
Comment or Delete Comment. The Show Comment option causes the comment to be
permanently displayed until the corresponding Hide Comment command is selected for the
cell.
Clearing or deleting cells
To clear the contents of one or a group of cells quickly, drag to select them, right-click and
select 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 there
are options for clearing the contents and the formatting of the cell separately.
To delete a single cell, right click with the cell selected and choose
Delete… from the pop-up menu. Excel prompts you with the dialog
shown. 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:
Step 2—Working with spreadsheet data
32
4. 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 the
corresponding commands from the Insert… option on the pop-up menu. When you’ve
finished, keep the workbook open, as we’ll use it in the next exercise.
Inserting and deleting cells, rows and columns
Using 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 changes
Just as with Word, Excel has two matching commands, Undo and Redo. You can find them
in 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 at
any time.
Editing cell data 33
Creating automatic series
The final editing technique you need to know about in Excel is referred to as auto-fill. Excel
offers this for use with adjacent cells to provide you with a very simple way of constructing
series of numerical values—whether they are numbers or dates. Try the following short
exercise:
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
values:
■ 0 and 10
■ ‘Mon’ and ‘Tue’
■ 12/12/06 and 13/12/06
Tip
Auto-fill works in the same way if you
drag to fill rows rather than columns.
Step 2—Working with spreadsheet data
34
Look at the auto-fill options after you have created the series of days and dates. Are they
different?
Searching for data, replacing data
Excel has a powerful Find command, just as Microsoft Word does. Excel’s Find command
allows you to search for numerical values, text, formula results or text in comments.
Searching for data
To demonstrate Excel’s Find command, you need to create a simple worksheet with some
useful 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:
5. Click in cell A1 to select it, then select Edit ➪ Find…
Excel displays the Find and Replace dialog, as shown in Figure 2.1.
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 characters
Searching for data, replacing data 35
6. 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.
13. 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.
Figure 2.1 Excel’s Find and Replace dialog
Figure 2.2 Excel’s expanded Find and Replace dialog
Step 2—Working with spreadsheet data
36
If 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 command
As you might imagine, replacing using the Find and Replace dialog is hardly more difficult
than 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 number
12 has a different context, as the table on page 34 shows, Excel is clever enough to replace
it with 14 in the correct context for each occurrence.
You can discard this workbook now, as we have finished with it.
Sorting data
Sorting numerical values is often useful, mainly because it makes lists of items easier for
humans to understand. For example, if you are using Excel to display tables of values, you
can use it to sort the tables into ascending or descending order.
Figure 2.3 Excel’s Find All feature in action
Sorting data 37
Excel 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 Return
5. 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
which set of numerical values you want to sort—
you don’t usually have to select all the cells to be
sorted explicitly.
Now for more complex sorts, using two columns
of 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).
Note
You can only sort data by one or more
columns—you cannot sort data by
rows.
Step 2—Working with spreadsheet data
38
8. 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.
11. 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.
3. 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).
Figure 2.4 Excel’s Sort Warning dialog
Figure 2.5 Excel’s Sort dialog
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 that
it must exclude the header rows from the sort.
Done!
Step 2—Working with spreadsheet data
40
Review
In 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.
Quiz
1. 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?
S T E P
3
Using spreadsheet
formulae
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 use
those results in other formulae. This is what we will concentrate on in this step.
Using Excel formulae
You have already learned that a cell whose contents start with ‘=’ is interpreted by Excel as
a formula. Excel will try to calculate the results of any formula it finds and displays the
results 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.
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 decisions
Y
Step 3—Using spreadsheet formulae
42
Excel functions
Excel functions provide the real mathematical power of Excel. A function in Excel is an
expression that calls a piece of code dedicated to a specific purpose. For example, the
formula:
=SUM(A1:A4)
calls the function SUM() to return the total of the cells A1, A2, A3 and A4, that is:
A1+A2+A3+A4
Excel contains over two hundred functions, which allow you to calculate results that would
be far too complex and tedious to program into a worksheet by hand. You can see this if you
select Insert ➪ Function… in a blank worksheet, then set Or select a category in the Insert
Function dialog to All. Many of them you will never use, as they are dedicated to complex
mathematical calculations that you are unlikely to encounter—at least, not yet. Some, such
as the SUM() function described above, are essential.
Excel’s functions are grouped by purpose, as the pop-up menu adjacent to the Or select a
category field in the Insert Function dialog shows. Most of the categories are self-
explanatory:
Category Includes
Database 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.
Using Excel formulae 43
We will demonstrate some of the more common functions in the examples in the sections
that follow.
Creating formulae
First we’ll repeat the simple exercise we first did on page 3, but with some changes to
illustrate 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.
Logical A set of functions for combining logical expressions, such as
AND(), OR(), IF(), and which return the values TRUE or
FALSE.
Lookup and
Reference
A set of functions for extracting data from look-up tables within
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.
Category Includes
χ
Step 3—Using spreadsheet formulae
44
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:
10. 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-
+ Add
- Subtract
* Multiply
/ Divide
Using Excel formulae 45
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 as
SUM(), but it’s really useful for functions with more, or more complex, arguments, or for
functions 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 functions
Next we’ll add a few more useful functions to our shopping list to show the cheapest and
most 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) Return
3. 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
Figure 3.1 Function Arguments dialog for SUM()
Step 3—Using spreadsheet formulae
46
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 formulae
When you write formulae in Excel, you need to remember that it has a predefined order of
priority for processing mathematical expressions. What we mean is that:
=3+4*12
in Excel give the answer 51—that is, Excel gives the multiplication a higher priority than the
addition, so does it first. So this expression is equivalent to:
=3+(4*12)
and not:
=(3+4)*12
which would give the answer 84. Excel uses the following order of priority when executing
formulae:
Priority Operator Description
Highest 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
Using relative and absolute cell references 47
You can override this order of priority by using brackets. Excel will first evaluate the
expression in the innermost pair of brackets, using the priority shown above, then the next
pair 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 references
You have seen how a formula in Excel can refer to the contents of other cells. You also saw
in the previous step how Excel helpfully edits cell references when you copy or move
formulae (refer back to How Excel handles cell references when cells are copied or moved on
page 28 if you need to). These references are written in the form:
cell row:cell row
For example:
C3:C5
Suppose however that you don’t want Excel to do this. Consider the case in which a cell
contains a number that you always want Excel to use, no matter how formulae that
reference it are copied or moved. Such a value might be something like a currency
conversion, 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 both
pounds 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.
Step 3—Using spreadsheet formulae
48
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 the
following 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!
Using mixed cell references 49
You can use the ‘$’ notation to make either the
column, the row, or both, references absolute.
For example, a cell reference of ‘$G2’ would
ensure that Excel never changed the column, but
could change the row, when such a reference was
moved or copied.
When you have finished, save your worksheet for
later.
Using mixed cell references
We 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 to
tell Excel to calculate the sum of cells A1 through A4 and D2 through D6? It’s easy—you
do it like this:
=SUM(A1:A4, D2:D6)
Try this now for yourself, using a blank
worksheet to experiment with. You can select
non-adjacent ranges of cells such as this by:
■ Clicking and dragging to make the first
selection
■ Holding down the Ctrl key
■ Clicking and dragging to make the second
selection.
Understanding Excel error messages
From time to time—although hopefully not too often—Excel will display an error message
in a cell instead of the answer you expect. This is fairly common when working with
formulae. For example, if you enter something like:
=C2*D2
in cell E2, but cell C2 contains text, Excel will display #VALUE! in E2. This is Excel’s way
of telling you that it can’t make sense of what you are trying to do (you can’t multiply text!).
Tip
When you are editing a formula in the
formula bar, the F4 key allows you to
toggle between all the combinations
of absolute, row-absolute, column-
absolute and relative references. Excel
is usually clever enough to work out
which reference to change.
Tip
You can ‘nest’ Excel functions. For
example:
=SUM(A1:A12,SUM(B1:B12))
means the same as:
=SUM(A1:A12)+SUM(B1:B12)
Step 3—Using spreadsheet formulae
50
Excel can display a wide variety of error messages. Those you are most likely to encounter
are:
Using conditional functions
Clearly we don’t have room, and you don’t have time, to learn about all the functions that
Excel offers. You need to know about the sum, average, minimum, maximum and count
functions 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 or
FALSE. For example, here is a conditional test:
A3>A4
which means ‘the contents of cell A3 is greater than the contents of cell A4’. Obviously, this
can only either be true or false. IF() allows you to include a test like this in a formula. It
returns 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, it
might be text:
=IF(A3>A4, "Above", "Equal or below")
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 functions 51
To see this in action, we’ll add a column to our shopping list that compares each item to the
average 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) Return
4. We want to add a new column for our
conditional test values, so click on the
column title of column E, then select Insert
➪ Columns. Excel adds a new blank column
for you.
Notice that your euro/£ conversion rate is
now in cell G2 and not cell F2. However,
your amounts in euros are still correct! If
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? Return
6. 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:
Note
If a cell that is the destination of an
absolute reference is itself moved as a
result of editing, Excel updates all the
absolute references to the cell to keep
it correct. This is usually precisely what
you want it to do.
Step 3—Using spreadsheet formulae
52
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:
Without an IF() function, it would be difficult or impossible to model this type of
calculation in a spreadsheet.
Balance Interest rate
< £1,000 3.75%
£1,000–£9,999.99 4.0%
£10,000–£99,999.99 4.25%
Done!
Using conditional functions 53
Review
In 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.
Quiz
1. 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?
S T E P
4
Improving a
sheet’s appearance
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’s
features for formatting numbers and text, highlighting and hiding information, preventing
the contents of a worksheet from accidental change, and generally making your worksheet
look beautiful. At the end of the step, your simple shopping list will have become a fully
formatted interactive form.
Setting display formats for data
Excel supports a huge range of display formats for numerical data, and if they are not
sufficient, you can define your own. You saw how these work in How Excel interprets data
entries on page 21. When you enter numerical data in a cell, Excel examines it, makes an
intelligent guess at what sort of number it is, and applies the appropriate formatting to the
number.
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 change
T
Step 4—Improving a sheet’s appearance
56
However, this might not be what you want in all cases. If you remember from Using relative
and 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 it
look better if the figures were given the correct currency symbol automatically? Here’s how
to 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…
4. Excel displays the Format Cells dialog.
The dialog contains tabs for Number,
Alignment, Font, Border, Patterns and
Protection. We’ll be visiting and using all of
these later in this step.
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-
Tip
The shortcut key for Format ➪ Cells…
is Ctrl-1, and it’s one that is worth
remembering, as you’re likely to use
the formatting dialog frequently.
Setting display formats for data 57
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
currency formatting to the maximum, minimum
and average values. Do this now using the Edit ➪
Paste Special… command. You can copy and
paste the formats of both currencies with only
three operations—try it yourself first before
reading the hint next.
When you have finished, save your shopping list workbook, as we’ll be using it again later.
Other useful number formats
Excel has many other numerical formats that are useful in specific situations. Before we
move on to formatting text, this section details some of the more common ones.
Figure 4.1 Excel’s Paste Special dialog
Tip
Copy C3:D3, click and drag to select
C8:D11, then Ctrl drag to include
C13:D13. Finally paste formats using
Edit ➪ Paste Special…
Step 4—Improving a sheet’s appearance
58
Using number separators
If you are displaying large numbers, but scientific format is inappropriate, you can tell Excel
to include number separators, so that one million, for example, is displayed as:
1,000,000
Try 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 dates
When you enter a number that Excel recognises as a date, it assigns a default format that is
based on the settings in Window’s Regional and Language Options control panel. For
example, if this is set to English (United Kingdom), entering:
1/1/5
in a cell causes Excel to format it and treat it as:
01/01/2005
that is, the 1st January 2005. Similarly, if you enter:
1-1-5
the same thing will occur. Or if you enter:
1-jan-5
Excel will interpret the date in the same way, but apply a different format:
01-Jan-05
It’s important to know that Excel handles all time and date variables in an identical way
internally. This is to allow it to carry out arithmetic on time and date values without you
having to write any complex expressions. Excel’s internal time/date format treats time as
starting from midnight on 1st January 1900. (Most of the time you don’t have to be aware
of that, although it does mean that you cannot calculate with dates earlier than 1900
directly.)
Setting display formats for data 59
Here’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
press Tab.
4. Reselect the cell and then select Format ➪
Cells… Note that Date is already selected as
the cell format’s Category.
5. Click to examine the Locale menu. This is
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.
Calculating and formatting percentages
Percentage values are used a great deal in business. Excel makes it easy to calculate and
format percentages. In fact, all that Excel does when you apply a percentage format to a
cell’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 divides
that number by 100 internally before using it in calculations.
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.
Note
It’s very important to realise that the
cell’s format only affects the way a
numerical value is displayed. Excel
always holds numerical data in the
same format internally.
Step 4—Improving a sheet’s appearance
60
To see how this works in practice:
1. Start with a blank worksheet.
2. Click in A1 to select it, then enter:
12 Return 4 Return
3. 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 a
percentage format to the result. You can apply the percentage format easily by clicking on
the 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 calculate
and 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 formats
If none of the display formats meet your needs, you can add your own. For example, assume
that you want to add a word to describe units such as weeks. You might want to do this for
a calendar or some other form that listed week numbers.
Setting display formats for text 61
It’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 and
save it with the current worksheet.
Excel allows you to create complex custom formats for display of date, time and numerical
information. For example, you might need a special format for a product code, something
like 12-453678-AW. This is possible in Excel. Equally, you can define a format that displays
one 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’s
available.
Setting display formats for text
We 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 interesting
things they do.
Setting font styles
You have already come across the button in Using relative and absolute cell
references on page 47, used to set headings and similar items in bold. Similarly, the
italic 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 are
located in the Format Cells dialog. We’ll use them here to change the fonts in your shopping
list 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,
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel
Guide to excel

More Related Content

What's hot

Office Enterprise2007 Product Guide
Office Enterprise2007 Product GuideOffice Enterprise2007 Product Guide
Office Enterprise2007 Product Guideguesteb5fd7f
 
WHAT CONSTITUTES AN AGILE ORGANIZATION? ? DESCRIPTIVE RESULTS OF AN EMPIRICAL...
WHAT CONSTITUTES AN AGILE ORGANIZATION? ? DESCRIPTIVE RESULTS OF AN EMPIRICAL...WHAT CONSTITUTES AN AGILE ORGANIZATION? ? DESCRIPTIVE RESULTS OF AN EMPIRICAL...
WHAT CONSTITUTES AN AGILE ORGANIZATION? ? DESCRIPTIVE RESULTS OF AN EMPIRICAL...iasaglobal
 
Word 2010
Word 2010Word 2010
Word 2010ulybka
 
How to-design-a-parametric-bookcase
How to-design-a-parametric-bookcaseHow to-design-a-parametric-bookcase
How to-design-a-parametric-bookcaseGherasim Marian
 
White Paper: Look Before You Leap Into Google Apps
White Paper: Look Before You Leap Into Google AppsWhite Paper: Look Before You Leap Into Google Apps
White Paper: Look Before You Leap Into Google AppsOffice
 
Excel fundamentals-manual
Excel fundamentals-manualExcel fundamentals-manual
Excel fundamentals-manualRAMAVATHSRINU3
 
Dotcomology the science of making money online
Dotcomology   the science of making money onlineDotcomology   the science of making money online
Dotcomology the science of making money onlineInnês Medrano
 

What's hot (16)

Office Enterprise2007 Product Guide
Office Enterprise2007 Product GuideOffice Enterprise2007 Product Guide
Office Enterprise2007 Product Guide
 
WHAT CONSTITUTES AN AGILE ORGANIZATION? ? DESCRIPTIVE RESULTS OF AN EMPIRICAL...
WHAT CONSTITUTES AN AGILE ORGANIZATION? ? DESCRIPTIVE RESULTS OF AN EMPIRICAL...WHAT CONSTITUTES AN AGILE ORGANIZATION? ? DESCRIPTIVE RESULTS OF AN EMPIRICAL...
WHAT CONSTITUTES AN AGILE ORGANIZATION? ? DESCRIPTIVE RESULTS OF AN EMPIRICAL...
 
c
cc
c
 
Word 2010
Word 2010Word 2010
Word 2010
 
PSA user manual
PSA user manualPSA user manual
PSA user manual
 
How to-design-a-parametric-bookcase
How to-design-a-parametric-bookcaseHow to-design-a-parametric-bookcase
How to-design-a-parametric-bookcase
 
White Paper: Look Before You Leap Into Google Apps
White Paper: Look Before You Leap Into Google AppsWhite Paper: Look Before You Leap Into Google Apps
White Paper: Look Before You Leap Into Google Apps
 
User manual
User manualUser manual
User manual
 
0931 excel-fundamentals
0931 excel-fundamentals0931 excel-fundamentals
0931 excel-fundamentals
 
Excel fundamentals-manual
Excel fundamentals-manualExcel fundamentals-manual
Excel fundamentals-manual
 
Corel draw learning file
Corel draw learning fileCorel draw learning file
Corel draw learning file
 
Dotcomology the science of making money online
Dotcomology   the science of making money onlineDotcomology   the science of making money online
Dotcomology the science of making money online
 
Dotcomology
DotcomologyDotcomology
Dotcomology
 
Cognos v10.1
Cognos v10.1Cognos v10.1
Cognos v10.1
 
Addendum
AddendumAddendum
Addendum
 
Access Tutorial
Access TutorialAccess Tutorial
Access Tutorial
 

Viewers also liked

Platt make electronics (o'reilly, 2009)
Platt   make electronics (o'reilly, 2009)Platt   make electronics (o'reilly, 2009)
Platt make electronics (o'reilly, 2009)yaxartes
 
Laboratory and physical assessment data (1)
Laboratory and physical assessment data (1)Laboratory and physical assessment data (1)
Laboratory and physical assessment data (1)Andrew Agbenin
 
Cross fit wod lists drivethrough.com 26 pgs
Cross fit wod lists drivethrough.com 26 pgsCross fit wod lists drivethrough.com 26 pgs
Cross fit wod lists drivethrough.com 26 pgstrab22
 
H1 N1 Flu 2009 Newsletter
H1 N1 Flu 2009 NewsletterH1 N1 Flu 2009 Newsletter
H1 N1 Flu 2009 NewsletterJohn Kuhles
 
Show me how 500 things you should know
Show me how 500 things you should knowShow me how 500 things you should know
Show me how 500 things you should knowyaxartes
 
The hacking bible kevin james
The hacking bible   kevin jamesThe hacking bible   kevin james
The hacking bible kevin jamesSumit Saini
 
7 new rules for writing the perfect cover letter
7 new rules for writing the perfect cover letter7 new rules for writing the perfect cover letter
7 new rules for writing the perfect cover letterSumit Saini
 
Gustakh e rasool giroh ke sexy mulla pdf
Gustakh e rasool  giroh ke sexy  mulla   pdfGustakh e rasool  giroh ke sexy  mulla   pdf
Gustakh e rasool giroh ke sexy mulla pdfMuhammad Tariq
 
Dr. Patrick Treacy looks at the history of lasers in Aesthetic Medicine
Dr. Patrick Treacy looks at the history of lasers in Aesthetic Medicine Dr. Patrick Treacy looks at the history of lasers in Aesthetic Medicine
Dr. Patrick Treacy looks at the history of lasers in Aesthetic Medicine Dr. Patrick J. Treacy
 
Powerpoint pres perinatal final (no animation)
Powerpoint pres perinatal final (no animation)Powerpoint pres perinatal final (no animation)
Powerpoint pres perinatal final (no animation)Ynneb Reine Manginsay
 
Neurology - history taking
Neurology - history takingNeurology - history taking
Neurology - history takingmeducationdotnet
 
Common laboratory & diagnostic procedures
Common laboratory & diagnostic proceduresCommon laboratory & diagnostic procedures
Common laboratory & diagnostic procedurescaalba
 

Viewers also liked (20)

Life cycle of hiv aids
Life cycle of hiv aidsLife cycle of hiv aids
Life cycle of hiv aids
 
Diabetes incipidus
Diabetes incipidusDiabetes incipidus
Diabetes incipidus
 
Platt make electronics (o'reilly, 2009)
Platt   make electronics (o'reilly, 2009)Platt   make electronics (o'reilly, 2009)
Platt make electronics (o'reilly, 2009)
 
7 conditional sentences
7 conditional sentences7 conditional sentences
7 conditional sentences
 
Otitis media CSOM
Otitis media CSOMOtitis media CSOM
Otitis media CSOM
 
Writing descriptive text
Writing descriptive textWriting descriptive text
Writing descriptive text
 
Laboratory and physical assessment data (1)
Laboratory and physical assessment data (1)Laboratory and physical assessment data (1)
Laboratory and physical assessment data (1)
 
701 e learning-tips
701 e learning-tips701 e learning-tips
701 e learning-tips
 
Cross fit wod lists drivethrough.com 26 pgs
Cross fit wod lists drivethrough.com 26 pgsCross fit wod lists drivethrough.com 26 pgs
Cross fit wod lists drivethrough.com 26 pgs
 
H1 N1 Flu 2009 Newsletter
H1 N1 Flu 2009 NewsletterH1 N1 Flu 2009 Newsletter
H1 N1 Flu 2009 Newsletter
 
Show me how 500 things you should know
Show me how 500 things you should knowShow me how 500 things you should know
Show me how 500 things you should know
 
The hacking bible kevin james
The hacking bible   kevin jamesThe hacking bible   kevin james
The hacking bible kevin james
 
7 new rules for writing the perfect cover letter
7 new rules for writing the perfect cover letter7 new rules for writing the perfect cover letter
7 new rules for writing the perfect cover letter
 
Gustakh e rasool giroh ke sexy mulla pdf
Gustakh e rasool  giroh ke sexy  mulla   pdfGustakh e rasool  giroh ke sexy  mulla   pdf
Gustakh e rasool giroh ke sexy mulla pdf
 
Dr. Patrick Treacy looks at the history of lasers in Aesthetic Medicine
Dr. Patrick Treacy looks at the history of lasers in Aesthetic Medicine Dr. Patrick Treacy looks at the history of lasers in Aesthetic Medicine
Dr. Patrick Treacy looks at the history of lasers in Aesthetic Medicine
 
Powerpoint pres perinatal final (no animation)
Powerpoint pres perinatal final (no animation)Powerpoint pres perinatal final (no animation)
Powerpoint pres perinatal final (no animation)
 
Vocabulary 4000© revised edition
Vocabulary 4000© revised editionVocabulary 4000© revised edition
Vocabulary 4000© revised edition
 
15 report writing
15 report writing15 report writing
15 report writing
 
Neurology - history taking
Neurology - history takingNeurology - history taking
Neurology - history taking
 
Common laboratory & diagnostic procedures
Common laboratory & diagnostic proceduresCommon laboratory & diagnostic procedures
Common laboratory & diagnostic procedures
 

Similar to Guide to excel

A Little Bit Of Help With Maple
A Little Bit Of Help With MapleA Little Bit Of Help With Maple
A Little Bit Of Help With MapleNathan Mathis
 
9780137564279_Sample.pdf
9780137564279_Sample.pdf9780137564279_Sample.pdf
9780137564279_Sample.pdfNormanApaza1
 
10. cutipa portillo, edy dany
10. cutipa portillo, edy dany10. cutipa portillo, edy dany
10. cutipa portillo, edy danyIESTPTECNOTRONIC
 
Ecdl v5 module 4 print
Ecdl v5 module 4 printEcdl v5 module 4 print
Ecdl v5 module 4 printMichael Lew
 
Sage Intelligence 100 Microsoft Excel Tips and Tricks
Sage Intelligence 100 Microsoft Excel Tips and TricksSage Intelligence 100 Microsoft Excel Tips and Tricks
Sage Intelligence 100 Microsoft Excel Tips and TricksBurCom Consulting Ltd.
 
Vic broquard c++ for computer science and engineering 2006
Vic broquard c++ for computer science and engineering 2006Vic broquard c++ for computer science and engineering 2006
Vic broquard c++ for computer science and engineering 2006Souvik Maity
 
Cs5 5-final-print-guide
Cs5 5-final-print-guideCs5 5-final-print-guide
Cs5 5-final-print-guideTrang Đoàn
 
Sage Intelligence 101 Microsoft® Excel® tips and tricks
Sage Intelligence 101 Microsoft® Excel® tips and tricksSage Intelligence 101 Microsoft® Excel® tips and tricks
Sage Intelligence 101 Microsoft® Excel® tips and tricksBurCom Consulting Ltd.
 
Meet Minitab 15 User's Guide ( PDFDrive ).pdf
Meet Minitab 15 User's Guide ( PDFDrive ).pdfMeet Minitab 15 User's Guide ( PDFDrive ).pdf
Meet Minitab 15 User's Guide ( PDFDrive ).pdfPTD QUYCOCTU
 
The Total Book Developing Solutions With EPiServer 4
The Total Book Developing Solutions With EPiServer 4The Total Book Developing Solutions With EPiServer 4
The Total Book Developing Solutions With EPiServer 4Martin Edenström MKSE.com
 
In designcs5 scripting tutorial
In designcs5 scripting tutorialIn designcs5 scripting tutorial
In designcs5 scripting tutorialMustfeez Rasul
 
SAP_HANA_Modeling_Guide_for_SAP_HANA_Studio_en
SAP_HANA_Modeling_Guide_for_SAP_HANA_Studio_enSAP_HANA_Modeling_Guide_for_SAP_HANA_Studio_en
SAP_HANA_Modeling_Guide_for_SAP_HANA_Studio_enJim Miller, MBA
 
Excel 2003 Charts
Excel 2003 ChartsExcel 2003 Charts
Excel 2003 Chartsbdthang
 
Chuck Moore Book 2012 01 26
Chuck Moore Book 2012 01 26Chuck Moore Book 2012 01 26
Chuck Moore Book 2012 01 26JuergenPintaske
 
FUNDAMENTOS DE MATEMATICAS
FUNDAMENTOS DE MATEMATICASFUNDAMENTOS DE MATEMATICAS
FUNDAMENTOS DE MATEMATICASVeraVelazquez
 

Similar to Guide to excel (20)

A Little Bit Of Help With Maple
A Little Bit Of Help With MapleA Little Bit Of Help With Maple
A Little Bit Of Help With Maple
 
9780735699236.pdf
9780735699236.pdf9780735699236.pdf
9780735699236.pdf
 
9780137564279_Sample.pdf
9780137564279_Sample.pdf9780137564279_Sample.pdf
9780137564279_Sample.pdf
 
Outlook
OutlookOutlook
Outlook
 
10. cutipa portillo, edy dany
10. cutipa portillo, edy dany10. cutipa portillo, edy dany
10. cutipa portillo, edy dany
 
Ecdl v5 module 4 print
Ecdl v5 module 4 printEcdl v5 module 4 print
Ecdl v5 module 4 print
 
Sage Intelligence 100 Microsoft Excel Tips and Tricks
Sage Intelligence 100 Microsoft Excel Tips and TricksSage Intelligence 100 Microsoft Excel Tips and Tricks
Sage Intelligence 100 Microsoft Excel Tips and Tricks
 
Vic broquard c++ for computer science and engineering 2006
Vic broquard c++ for computer science and engineering 2006Vic broquard c++ for computer science and engineering 2006
Vic broquard c++ for computer science and engineering 2006
 
Cs5 5-final-print-guide
Cs5 5-final-print-guideCs5 5-final-print-guide
Cs5 5-final-print-guide
 
Sage Intelligence 101 Microsoft® Excel® tips and tricks
Sage Intelligence 101 Microsoft® Excel® tips and tricksSage Intelligence 101 Microsoft® Excel® tips and tricks
Sage Intelligence 101 Microsoft® Excel® tips and tricks
 
C++ progrmming language
C++ progrmming languageC++ progrmming language
C++ progrmming language
 
Meet Minitab 15 User's Guide ( PDFDrive ).pdf
Meet Minitab 15 User's Guide ( PDFDrive ).pdfMeet Minitab 15 User's Guide ( PDFDrive ).pdf
Meet Minitab 15 User's Guide ( PDFDrive ).pdf
 
The Total Book Developing Solutions With EPiServer 4
The Total Book Developing Solutions With EPiServer 4The Total Book Developing Solutions With EPiServer 4
The Total Book Developing Solutions With EPiServer 4
 
In designcs5 scripting tutorial
In designcs5 scripting tutorialIn designcs5 scripting tutorial
In designcs5 scripting tutorial
 
Tips for MS Excel.pdf
Tips for MS Excel.pdfTips for MS Excel.pdf
Tips for MS Excel.pdf
 
E views 9 command ref
E views 9 command refE views 9 command ref
E views 9 command ref
 
SAP_HANA_Modeling_Guide_for_SAP_HANA_Studio_en
SAP_HANA_Modeling_Guide_for_SAP_HANA_Studio_enSAP_HANA_Modeling_Guide_for_SAP_HANA_Studio_en
SAP_HANA_Modeling_Guide_for_SAP_HANA_Studio_en
 
Excel 2003 Charts
Excel 2003 ChartsExcel 2003 Charts
Excel 2003 Charts
 
Chuck Moore Book 2012 01 26
Chuck Moore Book 2012 01 26Chuck Moore Book 2012 01 26
Chuck Moore Book 2012 01 26
 
FUNDAMENTOS DE MATEMATICAS
FUNDAMENTOS DE MATEMATICASFUNDAMENTOS DE MATEMATICAS
FUNDAMENTOS DE MATEMATICAS
 

Recently uploaded

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 

Recently uploaded (20)

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

Guide to excel

  • 2.
  • 3. Contents Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v 1 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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17 2 Working with spreadsheet data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21 How Excel interprets data entries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21 Editing cell data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 Searching for data, replacing data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34 Sorting data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 3 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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 4 Improving a sheet’s appearance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 Setting display formats for data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 Setting display formats for text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 Using cell borders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65
  • 4. Contents iv 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
  • 5. Preface 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 you have 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 Microsoft Windows XP on which a copy of Microsoft Office XP Professional or Microsoft Excel 2002 has been installed. Overview We have tried to design the steps so that many of them can be completed in a minimum of about 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 up the appearance of a spreadsheet, for example for a presentation, working with charts and graphs, and finally preparing and printing spreadsheet data. T
  • 6. Preface vi Layout and features You shouldn’t try to get through all the steps without a break. After each step there are questions you can use to check your knowledge and to practise what you have learned. The book also gives you signposts to help you keep track of your progress and to highlight interesting or important points. To allow you to chart your progress, you’ll find icons like this in the margin to show you how far you have progressed through each step. We also use the panels shown on the right to highlight special or important pieces of information. Conventions used in the steps Apart from the graphics mentioned above, the following 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. Note It’s important to remember this. Tip This can make your life easier. Warning Be aware of this. Stop! Don’t do this.
  • 7. S T E P 1 Getting started with Excel 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 with spreadsheet 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 working with numbers—although not only numbers. Why would you want to do that? There are few aspects of business that don’t involve working 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, estimation and so on in the work of most businesses. This is where spreadsheets excel (no pun intended). The term ‘spreadsheet’ comes from traditional accounting practice. It was used to describe the format used in book-keeping ledgers, in which expenditure categories were arranged as Checklist ■ Introduction to spreadsheets ■ Excel’s basic user controls ■ Creating, opening and saving workbooks ■ Working with worksheets ■ Customising Excel ■ Getting help T
  • 8. Step 1—Getting started with Excel 2 columns, and amounts were added in the relevant columns, with each row representing a transaction. 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 see something like Figure 1.1. Do it now using Start ➪ All Programs ➪ Microsoft Excel. It looks a bit like a table, and that’s a useful way of thinking about it. Look at the blank document on your screen. As you can see, it is divided into cells, each of which 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. Figure 1.1 A blank Excel document
  • 9. 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 in other cells. This means that once you have defined your formula, merely changing the numbers 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 Excel document. 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?
  • 10. Step 1—Getting started with Excel 4 Let’s explain what’s going on here. Entering ‘=’ as the first item in a cell tells Excel that you want 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 including cells C5 and C8, that is: C5 + C6 + C7 + C8 and display the result in the cell that contains the function. We will go into more detail about functions in Step 3. You may still be wondering what all the fuss is about. But now go back to your shopping list and try entering different values for the costs of individual items. Can you see that the total updates itself automatically? Now imagine a large sheet with much more complex calculations and many more totals—change any input information, and all the calculations are updated automatically, just as with this simple total. Now imagine the results plotted on a graph within the spreadsheet, and seeing that updated automatically. That is where the power of a spreadsheet program lies. That, in essence, is what spreadsheets are all about—ensuring that calculations of almost any complexity only have to be defined once, but can be repeated endlessly just by entering new numbers. Keep your shopping list open, as we’ll use it again shortly. Some clarity and some confusion So far we’ve been referring to Excel as a ‘spreadsheet’, or ‘spreadsheet program’. This is because ‘spreadsheet’ is the term in common use. In fact the term Excel itself uses is worksheet, usually shortened to sheet. A new Excel document, by default, contains three worksheets—for no particular reason other than it’s more than two and less than four—and the entire document is referred to as a workbook. These are the terms we will use from now on. 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 multiple worksheets 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’s for later.
  • 11. A trip around the interface 5 A trip around the interface Figure 1.2 shows a labelled version of Figure 1.1, and below we’ll explain the purpose of the major controls. This time we’ve re-enabled the task pane using View ➪ Task Pane. Travelling 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 The formatting toolbar Task pane Column titles Row titles Cell selector Formula bar The standard toolbar More tools hiding here… …and here Help Horizontal scroll bar (obscured by task pane) Worksheet tabs Menu bar Worksheet selector widgets Vertical scroll bar (obscured by task pane) Figure 1.2 Excel’s user interface
  • 12. Step 1—Getting started with Excel 6 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! 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
  • 13. A trip around the interface 7 As with your work with Word, this may seem a lot to remember. Don’t worry—it will become more familiar as you work with the application. Enabling and disabling toolbars Excel has twenty-nine toolbars, most of which are for special purposes. Those that you will probably find most useful initially are the Standard, Formatting, Tables and Borders and Drawing 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 suit the way in which you want to work with Excel. There’s more about toolbars later in this step. Using different views Excel allows you to use zooming to change the magnification of your worksheet in much the same way as Word does with documents. The zoom/magnification setting applies to the current 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.
  • 14. Step 1—Getting started with Excel 8 Full screen viewing is useful when you are working with large worksheets, or if you are working only in Excel. 4. Now select File ➪ New and click on Blank workbook in the task pane to open a new blank workbook. 5. Select the Window menu. Note that Excel 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 icon in the workbook window—not the entire application’s close icon. Locking rows and columns Much of the work you will do in Excel consists of handling tables of information. If you use a row at the top of a worksheet for titles, it’s really useful to be able to keep that on screen while scrolling 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 row remains locked on screen. Remember: To unfreeze panes, select Window ➪ Unfreeze Panes. To lock a row Select the row below the row you want to lock, then select Window ➪ Freeze Panes To lock a column Select the column to the right of the column you want to lock, then select Window ➪ Freeze Panes Tip A quick way to scroll around a worksheet is to click in a cell near the top, bottom or side of the sheet and drag in the direction you want to scroll. Excel moves the hidden cells into view as you do so. Warning Note that Excel has two Close icons, one for the foreground workbook, and one for the entire application window. Don’t confuse them.
  • 15. Opening, saving, closing, reopening 9 Opening, saving, closing, reopening If you worked through the steps on Microsoft Word, you’ll be familiar with the operations of 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’. 2. 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 the workbook without requesting a name (it already has one). If you want to save a copy of the workbook under another name, select File ➪ Save As… This displays the dialog shown in Figure 1.3 again, allowing you to supply a new name for the copy of the document. Figure 1.3 Excel’s Save As dialog
  • 16. Step 1—Getting started with Excel 10 Excel’s alternative file types Excel offers a variety of alternative file types in addition to Workbook. Other file types include Web page format and text. You need to know about several of these. For the moment, be aware of the fact that there is a Save as type field in the Save As dialog—we will return to alternative file types in Step 6. The alternative format that is likely to be most useful to you is Template. Working with worksheets You have already seen how a default workbook contains three worksheets. You might be wondering at this stage why you would want more than one worksheet. Here are a few things 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 your shopping list example, or a blank worksheet—it’s up to you. Adding a new worksheet To 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. To move 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. Tip Excel templates provide you with an easy way to create new workbooks with the same formatting and layout as an original. If you are likely to want to create several workbooks with the same formulae and layout, it’s worth saving the first one as a template.
  • 17. Working with worksheets 11 3. Select (move to end) and click on OK. Excel moves the selected worksheet to the end of the list of worksheets. Renaming a worksheet When 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. Figure 1.4 Excel’s Insert dialog Figure 1.5 The Move or Copy dialog
  • 18. Step 1—Getting started with Excel 12 Deleting a worksheet As 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 you select it. Click on Delete to delete the worksheet. Copying a worksheet to another workbook To carry out this exercise, you first need to create 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 the foreground, 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. To use the same procedure to copy a worksheet within a workbook, don’t make any selection in the To book pop-up menu. Figure 1.6 Deleting a non-empty worksheet Warning Once you click on Delete, the data that the sheet contained is gone for good— there is no Undo operation!
  • 19. Bending Excel to your will 13 Bending Excel to your will As with Microsoft Word, many features of Excel are customisable. This section lists a few of the things you might want to change, and also gets you familiar with how to change Excel’s many options. Many, but not all, of these options lurk behind the Tools ➪ Options and Tools ➪ Customize commands. Take a look at what’s there while you follow the following simple exercises. Partial or full menus? By default Excel only displays partial menus, which adapt to list the commands you use most 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 in the menu. Figure 1.7 Worksheet after copying
  • 20. Step 1—Getting started with Excel 14 Here’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 recalculation By 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 when you press the F9 key, rather than whenever you enter new data. Setting the default location for documents By default, Excel will offer you your My Documents folder in open and save dialogs. If this is ok for you, you don’t need to change anything. If you decide that you want a different default 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 toolbars As with Word, Excel displays the Standard and Formatting toolbars by default. It displays other toolbars in specific circumstances, such as the Drawing toolbar if you insert a drawing into a worksheet. In Office XP Excel has twenty-nine toolbars, plus the menu bar, and on
  • 21. Bending Excel to your will 15 top of that, you can create your own. Many of Excel’s toolbars are for special purposes, and you are only likely to come across them if you start using Excel for complex mathematical or financial work. If you are a ‘visual’ person, someone who works easily with icons, toolbars will be useful to you. Not everyone is, so you need to know how to control Excel’s toolbars so that you can adapt it to match the way you want to work. The following sections are very similar to those relating to Word’s toolbars, but we repeat them here so that you can refresh your knowledge. Displaying a toolbar To display a concealed toolbar, select View ➪ Toolbars… and then select the toolbar you want to display. The usefulness or otherwise of the various toolbars will become clearer as you 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 defaults If you find yourself working with the same toolbars all the time, you can tell Excel to display them 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 time you start up the application. Customising a toolbar To complete our discussion of toolbars, we’ll see how easy it is to add or remove commands from 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.
  • 22. Step 1—Getting started with Excel 16 ■ To add back the default buttons, click on the toolbar options widget and select Add or Remove Buttons ➪ Standard, then reselect the button you want to replace. (This requires a bit of menu gymnastics!) If you accidentally remove an entire menu, use 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 organised into menus for you in the Commands list. Figure 1.8 shows a handy Clear menu added in this way. This method can be used with Word too, of course, as the handling of toolbars is identical to Excel’s. Adding document details Excel saves extra information with worksheets in the same way that Word does with documents—a worksheet’s title (not the same as its file name), subject, author, category and 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. Note As Excel treats the menu bar as just another toolbar, it’s possible to Alt- drag an entire menu off the menu bar! If you do this, you will need to use a different method to replace the menu. Figure 1.8 A new Excel menu
  • 23. Shortcut keys 17 Try this now with your shopping list workbook: 1. Select File ➪ Properties. It’s quite likely that you’ll see something like Figure 1.9. 2. 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 keys As an alternative to using the menu commands, Excel offers you shortcut keys. These are key combinations, typically including a modifier key, that perform a specific function such as selecting a menu command. See the table on the next page for the essential shortcut keys you need to know in Excel. Getting help on Excel If you did not disable the Office Assistant when you worked through the steps on Word, all you have to do to get help in Excel is to click on it, popping up a dialog into which you can type your question. If you disabled the Office Assistant, you can get the same results by typing a question into the help field in the menu bar. Figure 1.9 Document properties
  • 24. Step 1—Getting started with Excel 18 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’s dialogs also have contextual help, which you can access by clicking on the icon. 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. Done!
  • 25. Getting help on Excel 19 Review In 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. Quiz 1. 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.
  • 26.
  • 27. S T E P 2 Working with spreadsheet data 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 entries Many computer applications have been described as ‘intelligent’, but Excel is one that has some claim to this title. It adopts the approach that a tool designed to work with numbers should be good at understanding numbers. For example, Excel applies a format automatically 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 Checklist ■ Entering data into Excel ■ Editing data in cells ■ Searching for and replacing data ■ Moving and copying data between cells and worksheets ■ Sorting data T
  • 28. Step 2—Working with spreadsheet data 22 12e2 Return 12/12/04 Return You should now see something like this: Can you see what Excel has done? Here’s a step-by-step description:1 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 You entered What Excel did 12 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. 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.
  • 29. Editing cell data 23 You should now see something like this: Here’s what’s happened: Excel has retained the formatting it applied automatically to these four cells. This may seem confusing at first, but it allows Excel to process all numerical data internally in the most efficient way, and display it in ways that make sense to us humans. We’ll return to formatting in more detail in Step 4. Editing cell data Just as Excel tries to make it easy for you to insert data, it also tries to help with editing data. In this section we’ll look at the ways you can move and copy data within and between worksheets, and at how you can create an automatic data series. 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’.
  • 30. Step 2—Working with spreadsheet data 24 Selecting cells, columns and rows Before we look at how to edit, move and copy the data in cells, you need to know how to select 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 dragging Once you have selected a cell or group of cells in a worksheet, you can drag them wherever you 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:
  • 31. Editing cell data 25 4. 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 commands Excel also has a pop-up menu that is displayed whenever you right-click in a worksheet. Try this short exercise 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.
  • 32. Step 2—Working with spreadsheet data 26 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 data To 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.
  • 33. Editing cell data 27 6. 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, even though the original data was not in adjacent columns. Moving and copying data between worksheets and workbooks Excel does not restrict you to working on one worksheet or workbook—you can work with multiple worksheets at a time, and can open as many workbooks as you wish. You can do this 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.
  • 34. Step 2—Working with spreadsheet data 28 1. 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 have to 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 menu commands instead. When you have finished practising moving and copying data, close both workbooks and discard the changes. How Excel handles cell references when cells are copied or moved The exercises above are all very well, but all we are moving is numbers. The power of Excel comes from the fact that cells can contain formulae that reference the contents of other cells. You may be wondering what happens to such cell references when the cell containing a formula is moved or copied. The answer is that Excel does what you normally want it to—
  • 35. Editing cell data 29 it 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. 2. Click in cell A1 to select it. 3. Enter 12 Tab =A1. This places the numerical value 12 in A1, and the expression =A1 in B1. This just tells Excel always to make the value displayed in B1 equal to the value contained in A1. Cell 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 are changed automatically by Excel to reference the same relative cells after the move or copy operation. This is normally what you want to happen. If it’s not, you can prevent it—we’ll go into more detail about this in Step 3. Note In step 3, note that the contents of B1 is the expression =A1, not 12. Cell B1 displays the value 12 because this is the result of the expression =A1. This may seem confusing until you become more familiar with Excel.
  • 36. Step 2—Working with spreadsheet data 30 Editing data in cells As you have seen, you insert data in cells by clicking in the cell and typing the data. To edit data already in a cell, click to select the cell and then edit the cell’s contents in the formula bar. When you click in the formula bar, Excel highlights any cells that are referenced by a formula in the cell being edited, using colour to distinguish them, as the illustration above shows (or would, if it were in colour). When you have made any changes you wish, the button 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 click on and drag any of the highlighted referenced cells. You do this by moving the mouse cursor over the edge of the highlighted cell you want to move, then click and drag it to the new location. Excel then adjusts the formula accordingly Practise this now, using some simple formula such as the one shown in the illustration above. Adding comments to cells You can add comments to individual cells. Comments are useful, for example to explain a formula, either for a colleague, or to remind yourself at a later date.
  • 37. Editing cell data 31 To enter a comment in a cell, select the cell, then select Insert ➪ Comment. Excel opens a window for your comment, titled with your name: To close the comment window, just click outside it. After you have done so, Excel shows a small red tag at the top-right corner of the commented cell. Moving the mouse pointer over the cell causes the comment to be displayed: To change or delete the comment, select the commented cell, right-click and select Edit Comment or Delete Comment. The Show Comment option causes the comment to be permanently displayed until the corresponding Hide Comment command is selected for the cell. Clearing or deleting cells To clear the contents of one or a group of cells quickly, drag to select them, right-click and select 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 there are options for clearing the contents and the formatting of the cell separately. To delete a single cell, right click with the cell selected and choose Delete… from the pop-up menu. Excel prompts you with the dialog shown. 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:
  • 38. Step 2—Working with spreadsheet data 32 4. 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 the corresponding commands from the Insert… option on the pop-up menu. When you’ve finished, keep the workbook open, as we’ll use it in the next exercise. Inserting and deleting cells, rows and columns Using 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 changes Just as with Word, Excel has two matching commands, Undo and Redo. You can find them in 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 at any time.
  • 39. Editing cell data 33 Creating automatic series The final editing technique you need to know about in Excel is referred to as auto-fill. Excel offers this for use with adjacent cells to provide you with a very simple way of constructing series of numerical values—whether they are numbers or dates. Try the following short exercise: 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 values: ■ 0 and 10 ■ ‘Mon’ and ‘Tue’ ■ 12/12/06 and 13/12/06 Tip Auto-fill works in the same way if you drag to fill rows rather than columns.
  • 40. Step 2—Working with spreadsheet data 34 Look at the auto-fill options after you have created the series of days and dates. Are they different? Searching for data, replacing data Excel has a powerful Find command, just as Microsoft Word does. Excel’s Find command allows you to search for numerical values, text, formula results or text in comments. Searching for data To demonstrate Excel’s Find command, you need to create a simple worksheet with some useful 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: 5. Click in cell A1 to select it, then select Edit ➪ Find… Excel displays the Find and Replace dialog, as shown in Figure 2.1. 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 characters
  • 41. Searching for data, replacing data 35 6. 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. 13. 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. Figure 2.1 Excel’s Find and Replace dialog Figure 2.2 Excel’s expanded Find and Replace dialog
  • 42. Step 2—Working with spreadsheet data 36 If 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 command As you might imagine, replacing using the Find and Replace dialog is hardly more difficult than 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 number 12 has a different context, as the table on page 34 shows, Excel is clever enough to replace it with 14 in the correct context for each occurrence. You can discard this workbook now, as we have finished with it. Sorting data Sorting numerical values is often useful, mainly because it makes lists of items easier for humans to understand. For example, if you are using Excel to display tables of values, you can use it to sort the tables into ascending or descending order. Figure 2.3 Excel’s Find All feature in action
  • 43. Sorting data 37 Excel 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 Return 5. 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 which set of numerical values you want to sort— you don’t usually have to select all the cells to be sorted explicitly. Now for more complex sorts, using two columns of 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). Note You can only sort data by one or more columns—you cannot sort data by rows.
  • 44. Step 2—Working with spreadsheet data 38 8. 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. 11. 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. 3. 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). Figure 2.4 Excel’s Sort Warning dialog Figure 2.5 Excel’s Sort dialog
  • 45. 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 that it must exclude the header rows from the sort. Done!
  • 46. Step 2—Working with spreadsheet data 40 Review In 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. Quiz 1. 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?
  • 47. S T E P 3 Using spreadsheet formulae 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 use those results in other formulae. This is what we will concentrate on in this step. Using Excel formulae You have already learned that a cell whose contents start with ‘=’ is interpreted by Excel as a formula. Excel will try to calculate the results of any formula it finds and displays the results 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. 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 decisions Y
  • 48. Step 3—Using spreadsheet formulae 42 Excel functions Excel functions provide the real mathematical power of Excel. A function in Excel is an expression that calls a piece of code dedicated to a specific purpose. For example, the formula: =SUM(A1:A4) calls the function SUM() to return the total of the cells A1, A2, A3 and A4, that is: A1+A2+A3+A4 Excel contains over two hundred functions, which allow you to calculate results that would be far too complex and tedious to program into a worksheet by hand. You can see this if you select Insert ➪ Function… in a blank worksheet, then set Or select a category in the Insert Function dialog to All. Many of them you will never use, as they are dedicated to complex mathematical calculations that you are unlikely to encounter—at least, not yet. Some, such as the SUM() function described above, are essential. Excel’s functions are grouped by purpose, as the pop-up menu adjacent to the Or select a category field in the Insert Function dialog shows. Most of the categories are self- explanatory: Category Includes Database 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.
  • 49. Using Excel formulae 43 We will demonstrate some of the more common functions in the examples in the sections that follow. Creating formulae First we’ll repeat the simple exercise we first did on page 3, but with some changes to illustrate 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. Logical A set of functions for combining logical expressions, such as AND(), OR(), IF(), and which return the values TRUE or FALSE. Lookup and Reference A set of functions for extracting data from look-up tables within 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. Category Includes χ
  • 50. Step 3—Using spreadsheet formulae 44 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: 10. 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- + Add - Subtract * Multiply / Divide
  • 51. Using Excel formulae 45 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 as SUM(), but it’s really useful for functions with more, or more complex, arguments, or for functions 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 functions Next we’ll add a few more useful functions to our shopping list to show the cheapest and most 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) Return 3. 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 Figure 3.1 Function Arguments dialog for SUM()
  • 52. Step 3—Using spreadsheet formulae 46 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 formulae When you write formulae in Excel, you need to remember that it has a predefined order of priority for processing mathematical expressions. What we mean is that: =3+4*12 in Excel give the answer 51—that is, Excel gives the multiplication a higher priority than the addition, so does it first. So this expression is equivalent to: =3+(4*12) and not: =(3+4)*12 which would give the answer 84. Excel uses the following order of priority when executing formulae: Priority Operator Description Highest 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
  • 53. Using relative and absolute cell references 47 You can override this order of priority by using brackets. Excel will first evaluate the expression in the innermost pair of brackets, using the priority shown above, then the next pair 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 references You have seen how a formula in Excel can refer to the contents of other cells. You also saw in the previous step how Excel helpfully edits cell references when you copy or move formulae (refer back to How Excel handles cell references when cells are copied or moved on page 28 if you need to). These references are written in the form: cell row:cell row For example: C3:C5 Suppose however that you don’t want Excel to do this. Consider the case in which a cell contains a number that you always want Excel to use, no matter how formulae that reference it are copied or moved. Such a value might be something like a currency conversion, 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 both pounds 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.
  • 54. Step 3—Using spreadsheet formulae 48 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 the following 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!
  • 55. Using mixed cell references 49 You can use the ‘$’ notation to make either the column, the row, or both, references absolute. For example, a cell reference of ‘$G2’ would ensure that Excel never changed the column, but could change the row, when such a reference was moved or copied. When you have finished, save your worksheet for later. Using mixed cell references We 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 to tell Excel to calculate the sum of cells A1 through A4 and D2 through D6? It’s easy—you do it like this: =SUM(A1:A4, D2:D6) Try this now for yourself, using a blank worksheet to experiment with. You can select non-adjacent ranges of cells such as this by: ■ Clicking and dragging to make the first selection ■ Holding down the Ctrl key ■ Clicking and dragging to make the second selection. Understanding Excel error messages From time to time—although hopefully not too often—Excel will display an error message in a cell instead of the answer you expect. This is fairly common when working with formulae. For example, if you enter something like: =C2*D2 in cell E2, but cell C2 contains text, Excel will display #VALUE! in E2. This is Excel’s way of telling you that it can’t make sense of what you are trying to do (you can’t multiply text!). Tip When you are editing a formula in the formula bar, the F4 key allows you to toggle between all the combinations of absolute, row-absolute, column- absolute and relative references. Excel is usually clever enough to work out which reference to change. Tip You can ‘nest’ Excel functions. For example: =SUM(A1:A12,SUM(B1:B12)) means the same as: =SUM(A1:A12)+SUM(B1:B12)
  • 56. Step 3—Using spreadsheet formulae 50 Excel can display a wide variety of error messages. Those you are most likely to encounter are: Using conditional functions Clearly we don’t have room, and you don’t have time, to learn about all the functions that Excel offers. You need to know about the sum, average, minimum, maximum and count functions 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 or FALSE. For example, here is a conditional test: A3>A4 which means ‘the contents of cell A3 is greater than the contents of cell A4’. Obviously, this can only either be true or false. IF() allows you to include a test like this in a formula. It returns 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, it might be text: =IF(A3>A4, "Above", "Equal or below") 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.
  • 57. Using conditional functions 51 To see this in action, we’ll add a column to our shopping list that compares each item to the average 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) Return 4. We want to add a new column for our conditional test values, so click on the column title of column E, then select Insert ➪ Columns. Excel adds a new blank column for you. Notice that your euro/£ conversion rate is now in cell G2 and not cell F2. However, your amounts in euros are still correct! If 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? Return 6. 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: Note If a cell that is the destination of an absolute reference is itself moved as a result of editing, Excel updates all the absolute references to the cell to keep it correct. This is usually precisely what you want it to do.
  • 58. Step 3—Using spreadsheet formulae 52 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: Without an IF() function, it would be difficult or impossible to model this type of calculation in a spreadsheet. Balance Interest rate < £1,000 3.75% £1,000–£9,999.99 4.0% £10,000–£99,999.99 4.25% Done!
  • 59. Using conditional functions 53 Review In 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. Quiz 1. 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?
  • 60.
  • 61. S T E P 4 Improving a sheet’s appearance 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’s features for formatting numbers and text, highlighting and hiding information, preventing the contents of a worksheet from accidental change, and generally making your worksheet look beautiful. At the end of the step, your simple shopping list will have become a fully formatted interactive form. Setting display formats for data Excel supports a huge range of display formats for numerical data, and if they are not sufficient, you can define your own. You saw how these work in How Excel interprets data entries on page 21. When you enter numerical data in a cell, Excel examines it, makes an intelligent guess at what sort of number it is, and applies the appropriate formatting to the number. 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 change T
  • 62. Step 4—Improving a sheet’s appearance 56 However, this might not be what you want in all cases. If you remember from Using relative and 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 it look better if the figures were given the correct currency symbol automatically? Here’s how to 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… 4. Excel displays the Format Cells dialog. The dialog contains tabs for Number, Alignment, Font, Border, Patterns and Protection. We’ll be visiting and using all of these later in this step. 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- Tip The shortcut key for Format ➪ Cells… is Ctrl-1, and it’s one that is worth remembering, as you’re likely to use the formatting dialog frequently.
  • 63. Setting display formats for data 57 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 currency formatting to the maximum, minimum and average values. Do this now using the Edit ➪ Paste Special… command. You can copy and paste the formats of both currencies with only three operations—try it yourself first before reading the hint next. When you have finished, save your shopping list workbook, as we’ll be using it again later. Other useful number formats Excel has many other numerical formats that are useful in specific situations. Before we move on to formatting text, this section details some of the more common ones. Figure 4.1 Excel’s Paste Special dialog Tip Copy C3:D3, click and drag to select C8:D11, then Ctrl drag to include C13:D13. Finally paste formats using Edit ➪ Paste Special…
  • 64. Step 4—Improving a sheet’s appearance 58 Using number separators If you are displaying large numbers, but scientific format is inappropriate, you can tell Excel to include number separators, so that one million, for example, is displayed as: 1,000,000 Try 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 dates When you enter a number that Excel recognises as a date, it assigns a default format that is based on the settings in Window’s Regional and Language Options control panel. For example, if this is set to English (United Kingdom), entering: 1/1/5 in a cell causes Excel to format it and treat it as: 01/01/2005 that is, the 1st January 2005. Similarly, if you enter: 1-1-5 the same thing will occur. Or if you enter: 1-jan-5 Excel will interpret the date in the same way, but apply a different format: 01-Jan-05 It’s important to know that Excel handles all time and date variables in an identical way internally. This is to allow it to carry out arithmetic on time and date values without you having to write any complex expressions. Excel’s internal time/date format treats time as starting from midnight on 1st January 1900. (Most of the time you don’t have to be aware of that, although it does mean that you cannot calculate with dates earlier than 1900 directly.)
  • 65. Setting display formats for data 59 Here’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 press Tab. 4. Reselect the cell and then select Format ➪ Cells… Note that Date is already selected as the cell format’s Category. 5. Click to examine the Locale menu. This is 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. Calculating and formatting percentages Percentage values are used a great deal in business. Excel makes it easy to calculate and format percentages. In fact, all that Excel does when you apply a percentage format to a cell’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 divides that number by 100 internally before using it in calculations. 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. Note It’s very important to realise that the cell’s format only affects the way a numerical value is displayed. Excel always holds numerical data in the same format internally.
  • 66. Step 4—Improving a sheet’s appearance 60 To see how this works in practice: 1. Start with a blank worksheet. 2. Click in A1 to select it, then enter: 12 Return 4 Return 3. 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 a percentage format to the result. You can apply the percentage format easily by clicking on the 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 calculate and 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 formats If none of the display formats meet your needs, you can add your own. For example, assume that you want to add a word to describe units such as weeks. You might want to do this for a calendar or some other form that listed week numbers.
  • 67. Setting display formats for text 61 It’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 and save it with the current worksheet. Excel allows you to create complex custom formats for display of date, time and numerical information. For example, you might need a special format for a product code, something like 12-453678-AW. This is possible in Excel. Equally, you can define a format that displays one 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’s available. Setting display formats for text We 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 interesting things they do. Setting font styles You have already come across the button in Using relative and absolute cell references on page 47, used to set headings and similar items in bold. Similarly, the italic 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 are located in the Format Cells dialog. We’ll use them here to change the fonts in your shopping list 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,