Professional Documents
Culture Documents
Spreadsheets enable you to store numerical data and formulae, which can
be used to carry out operations on the numerical data. These formulae
are applied to the data whenever you make a change to it. If you change
any data values, the entire spreadsheet is automatically recalculated.
This is one of the most important features of a spreadsheet. The ability
to represent the numerical data quickly and easily as a graph is another
important advantage.
A spreadsheet can also be used to set up numerical and financial models
that can be used to help novices learn how these work and to forecast
future events.
Here are some examples of the uses of spreadsheets:
• Loan calculations
• Financial plans 2 e.g. budgeting
• Keeping accounts in a club or for a business
• Statistics 2 e.g. finding averages or calculating the standard deviation
Spreadsheets are made up of several worksheets. It is the active worksheet
that you see on the screen. Multiple worksheets can be used to hide
complex data and calculations so that the user is presented with a
simplified summary. This feature is very useful in modelling.
Various spreadsheet software is available, such as the Calc spreadsheet
(part of OpenOffice), Lotus 1-2-3 (part of Lotus SmartSuite) and Excel
(part of Microsoft Office). The examples in this chapter are illustrated
using Microsoft Office Excel 2007 running on the Windows XP operating
system.
Basic concepts
Spreadsheet software initially displays on the screen a large grid divided
into rows and columns. This is the active worksheet. A typical screen
display has horizontal rows from left to right which are numbered, and
columns up and down the screen which are named using letters. What is
displayed on the screen is only a small part of the available worksheet. For
example, the initial screen displayed by Excel is shown in Figure 5.1.
98
Ribbon
Row
Labels
(text)
Worksheet
window
Values
(numbers)
HINT!
Cell references
Each cell in the active worksheet can be identified by its cell reference, If you are using a spreadsheet
which is the column position and the row position combined. For other than Excel, you must
example, the address F6 means that the cell is in column F and row 6. remember that formula may not
start with 5.
The active cell is the cell which is currently selected. For example, in You should change any 5 you
Figure 5.1, the cell F6 is the active cell. The cell reference F6 only refers to find used in this chapter to your
a single cell, but you can use a cell range reference to refer to a range of special symbol that indicates a
cells. For example, in Figure 5.1, the data for January is contained in cells formula.
C4:C6 in column C, and the sales figures are in cells C4:F4 on row 4.
99
Figure 5.2 c
Sample spreadsheet with the range
B2:D4 selected
Exercise 5.1
1. Write down the name of the spreadsheet package you are using.
2. Describe what is meant by the following and give examples to
illustrate your answer:
a) Cell b) Cell reference
c) Range reference d) Value
e) Formula f) Worksheet
3. Look at the
Figure 5.3 c
spreadsheet
Sample spreadsheet for Exercise 5.1
in Figure 5.3.
100
Alignment
After entering data, notice that numbers move to the right of the cell (they
are right-aligned) and labels (text) move to the left (they are left-aligned).
These alignments occur automatically, but can be changed.
In Excel, you can align the contents of a cell or range of cells by
The Align buttons
highlighting them and clicking one of the Align buttons in the Ribbon. in Excel
101
Exercise 5.2
102
Example in
Operator Description Comment
Excel
adds the contents of cells B3
1 Addition 5B31B6
and B6 DID YOU KNOW?
subtracts the contents of cell
2 Subtraction 5C4-C5 C5 from the contents of cell An expression in a formula
C4 in a spreadsheet follows the
multiplies the contents of same order of precedence as
* Multiplication 5D6*E6 for normal arithmetic. This
cells D6 and E6
means that whatever is within
divides the contents of cell D3
/ Division 5D3/D4 brackets is performed first, then
by the contents of cell D4
multiplication and/or division,
Exponentiation and then addition and/or
squares the contents of cell
^ (raising to a
power)
B7^2
B7 subtraction.
Exercise 5.3
103
Figure 5.4 c
Calculating sales and profit
b Figure 5.5
Sample spreadsheet using sales figures
104
Exercise 5.4
105
Copying a formula
You can cut or copy and paste a formula in the same way that you cut or
copy and paste other cells. However, in Excel there is a particular method
of copying cells that is useful when you copy formulae. You can copy a
formula in the active cell to the cells in the same column immediately
above or below it by dragging the fill handle. You can also copy to the left
and right on the same row using this method, which is called replication.
Exercise 5.5
Figure 5.7 c
Data for calculating a final selling
price
106
b Figure 5.8
Calculation of the final selling price
9. Adjust column widths and row heights so that the data in all the
cells can be seen.
10. Save the spreadsheet with the name ‘Selling Price’.
11. Print the spreadsheet.
Other functions
There are many other functions in addition to the SUM function. Here are
some examples:
The MAX (maximum) function is used to find the largest value of a set of
values in a row or column. The general form of the maximum function
is 5MAX(first cell:last cell). For example, if you want to find the item
with the highest price in the spreadsheet in Figure 5.8, use the formula
5MAX(E5:E9).
The MIN (minimum) function is used to find the smallest value in a set
of values in a row or column. The general form of the minimum function
is 5MIN(first cell:last cell). For example, if you want to find the item
with the lowest price in the spreadsheet in Figure 5.8, use the formula
5MIN(E5:E9).
The AVERAGE function is used to find the mean of a set of values. The
general form of the function is 5AVERAGE(first cell:last cell). To find
the mean price of an item in the spreadsheet in Figure 5.8, use the formula
5AVERAGE(E5:E9).
Formatting
Using formatting, you can control the appearance of cells and of the
spreadsheet in general. We have already looked at one aspect of formatting
2 the alignment of the contents of cells. Changing the column width,
107
Formatting numbers
Here are some formats for numbers:
• General 2 if you want no specific number format
• Number 2 used for general display of numbers with decimal places
and a negative sign
• Currency 2 used to represent monetary values (e.g. $589.54)
Exercise 5.6
The manager of the Premium Furniture Store Company would like the following information:
a) The profits before tax if the expenditure for the branches is as follows:
Branch Expenditure
North 5000
South 6754
East 3476
West 9034
108
4. Enter the expenditure data into the appropriate cells (see Figure 5.9).
5. Select cell G5. Enter the label Profit before Tax.
6. Change the width of the cell to accommodate the label.
7. Select cell G6. Enter the formula 5E6-F6. Copy the formula down to G9.
8. Select cell H5. Enter the label Tax on Profit and change the column width.
9. Select cell H6. Enter the formula 5G6 * .15. Copy the formula down to H9.
10. Select cell I5. Enter the label Profit after Tax and change the column width.
11. Select cell I6. Enter the formula 5G6-H6. Copy the formula down to I9.
12. Highlight or mark off the range B6 to I10. Change the number format to currency.
13. Select cell A13. Enter the label Maximum Profit.
14. Select cell C13. Enter the formula 5MAX(I6:I9).
15. Select cell A14. Enter the label Minimum Profit.
16. Select cell C14. Enter the formula 5MIN(I6:I9).
17. Select cell A15. Enter the label Average Profit.
18. Select Cell C15. Enter the formula 5AVERAGE(I6:I9).
19. Copy cell B10 across to cells C10: I10.
20. Highlight C13 to C15. Change the number format to currency if necessary.
21. Adjust column widths and row heights so that the data in all the cells can be seen.
22. Save the spreadsheet as ‘Premium Profit’.
23. Print the spreadsheet. . Figure 5.9
Spreadsheet at the end
After completing these steps, your spreadsheet should look like Figure 5.9. of Exercise 5.6
109
Figure 5.10 c
The Sort dialog box
110
Exercise 5.7
The spreadsheet in Figure 5.11 shows a list of books from a supplier to the Small Book Store. Do the following:
1. Create the worksheet.
2. Make the title and the labels in row 3 bold.
3. Sort the data into ascending order by author and then by title. Save the spreadsheet as ‘Small Books’.
4. Add a column to calculate the total cost for each title.
(Total cost 5 No. of copies * Unit cost)
5. Adjust column widths and row heights so that the data in all the cells can be seen.
6. Save the spreadsheet.
7. Print the spreadsheet. . Figure 5.11 Book list
Figure 5.12 c
A sales chart with its elements named
Chart elements
A graph or chart has several elements:
• Axes 2 The vertical and horizontal lines against which data is plotted.
The horizontal X-axis is referred to as the category axis and the vertical
Y-axis is known as the value axis.
• Titles 2 There are three titles: for the chart, the category axis and the
value axis.
• Data range 2 The range of cells selected to create the chart.
• Data labels 2 The actual value, percentage or name of a bar or
segment of a chart.
• Data table 2 The range of values, included at the bottom of the chart,
that is used to draw the graph.
• Series 2 The data in a row or column that makes up the range of
values that is used to create the graph.
• Legend 2 A cross-reference showing how each series is represented in
the chart.
• Gridlines 2 Lines parallel to each axis that help you read values from
the graph more easily.
Creating a chart
In Excel, you can use the Insert tab to create graphs and charts, as follows:
• Select the data to be displayed and click the Insert tab.
• Choose a type of graph from the Charts area.
• You can fine-tune the chart using the options in the Chart Tools tabs.
112
Enhancing a chart
Charts can be customised or enhanced for variety and emphasis.
A slice of a pie chart can be offset from the main body of the pie, perhaps
for emphasis. In Figure 5.13, the slice representing the number of Ford
vehicles in a car park has been offset slightly from the main body of the
pie chart so it stands out.
b Figure 5.13
A pie chart with
a slice offset for
emphasis
Figure 5.14 c
The Format Data Point dialog box
113
The IF function
The IF function tests a condition to see if it is true or false.
The general form of the IF function is as follows:
5IF(condition, what to do if the condition is true, what to do if the
condition is false)
When the function is executed, the first instruction (what to do if the
condition is true) is executed if the condition is true, and the second
instruction (what to do if the condition is false) is executed if the condition
is false. Either instruction can be text, a number, a formula, a function or
a cell address. If an instruction is text or a number then this is displayed.
If the instruction is a formula, function or cell address, the result, and not
the instruction itself, will be displayed. For example, consider the function
5IF(F5 > 50000, 10, 8). If the value in cell F5 is greater than 50 000, the
number 10 will be displayed in F5. If the value in F5 is less than 50 000,
EXTENSION the number 8 will be displayed.
QUESTIONS
The logical operators which can be used in the IF function are as follows:
Cell E4 contains this formula:
IF(D4<50, “reorder”, “stock Operator Meaning
levels adequate”). > Greater than
• Write down what will be 5 Equal to
displayed in cell E4 if the
value in cell D4 is 55. >5 Greater than or equal to
• Write down what will be < Less than
displayed in cell E4 if the <5 Less than or equal to
value in cell D4 is 23.
<> Not equal to
114
The First Trinidad National Bank pays a yearly interest of 8% on fixed-deposit balances less than or equal to
$50 000, and 10% on fixed-deposit balances greater than $50 000. The interest earned is then added to the
customer’s balance at the beginning of the year to give the final balance.
b Figure 5.15
Banking spreadsheet
The spreadsheet in Figure 5.15 shows some customers and their balances. The function 5IF(B4 <5 50000,
8%, 10%) in cell C4 compares the value in cell B4 to see if it is less than or equal to 50 000. Since the value
is 45 000, the condition is true, so the value 8% is returned. However, if the value in cell B4 had been greater
than 50 000, the value 10% would have been returned, as is the case for C5 and C6.
1. Create the worksheet shown in Figure 5.15.
2. Insert five additional customers and their starting balances.
3. A 15% tax is charged on interest earned if this is more than $5 000. Insert a column with the heading
‘Tax’, and calculate the tax paid by each customer.
4. Calculate the interest after tax.
5. Calculate the final balance (starting balance 1 interest after tax).
6. Adjust column widths and row heights so that the data in all the cells can be seen.
7. Save the spreadsheet with the file name ‘Banking’.
8. Print the spreadsheet.
Look-up tables
The idea behind a look-up table is that if you know something about a
person or object, you can look up other information. Look-up tables are
widely used. If you know someone’s name, you can look up his or her
telephone number in a telephone directory or your address book.
In Excel, the general form of the function used to look for information in
spreadsheet tables is as follows:
5LOOKUP(what you are looking for, where you want to look, where the
information you want is)
115
b Figure 5.16
List of ingredients in the Ingredients worksheet
Figure 5.17 c
The default multiple worksheets in Excel
Renaming worksheets
The default worksheets can be renamed so they reflect the purposes of the
individual worksheet (see Figure 5.18). In Excel, to rename a worksheet,
right-click on the worksheet tab, in the menu select Rename and type in
the new name.
Figure 5.18 c
The worksheets renamed
Look-up tables are particularly useful when used with multiple worksheets
within a spreadsheet. You can store information on one worksheet
and refer to it in another; and you can use the results calculated in one
worksheet as part of a calculation in another worksheet. For example, you
could put your budget for each month on a separate worksheet and use
another worksheet to summarise your earnings and savings for the year.
116
b Figure 5.19
The Cost of dish worksheet
117
The chef wants to make spicy chicken and egg with noodles. Noodles
will cost £1.75. Use the Cost of dish worksheet to work out the cost of
this dish.
Macros
Macros are used to perform repetitive tasks. Macros in a spreadsheet differ
from macros in a word processor only because the different applications
can do different tasks. In Excel, you can record macros in the same way as
you would in Word, and you can assign macros to buttons so that when
you press the button the macro runs. This can be a very convenient way of
running a macro.
Exercise 5.11
Figure 5.20 c
Jean’s budget
118
b Figure 5.21
The Form Controls
Modelling
Models are representations of the real world. We are all familiar with
some form of model. Our earliest introduction to modelling is likely to be
moulding modelling clay to make representations of people or animals.
You can buy toy soldiers and model cars, dolls and dolls’ houses. They are
all models; that is, representations of the real world. Models in some form
are used throughout commerce and industry. You can build a physical
model of a shopping centre or other building project to demonstrate the
architectural style and layout of the planned development. Models of such
developments can also be built using computer software.
119
Spreadsheet models
Spreadsheets can be used for a variety of tasks. We can use spreadsheets
to record information from day to day and to do simple calculations.
However, when a model is constructed using a spreadsheet, there is usually
an intention to use it to improve our understanding of a real system, for
problem solving or for prediction.
A spreadsheet-based model is likely to:
• allow a range of input variables to be set
• use formulae to define the rules on which the model is based
• produce output based on the input variables and the rules.
Typically, a spreadsheet-based model will have a limited number of input
variables. These variables will be processed using the rules defined by the
structure of the spreadsheet and the underlying formulae. These rules
will reflect the assumptions made by the author about the relationships
evident in the real world. These relationships will be built into the model.
However, the author may simplify these relationships or otherwise modify
them. The rules built into a model when it is constructed do not always
exactly reflect the complexities of the real world.
The models described below were constructed using a spreadsheet. You
may be expected to set up such models yourself. Alternatively, your teacher
may set them up for you and you would be expected to explore the extent
to which they represent the real world and to adjust the underlying rules
so that they more closely mimic reality.
120
b Figure 5.22
The price forecast model
The input variables are the initial price, the base year and the rate of
inflation. These can be changed so that the effects of inflation can be
modelled. QUICK QUESTION
The rules are the formulae in the cells C7 to C16. Explain why the formula in
The formula in C7 is 5$A$4. Its effect is to copy the initial price from A4. C8 uses both absolute cell
referencing ($E$4) and relative
The formula in C8 is 5C71C7*$E$4. Its effect is to increase the initial
cell referencing (C7).
price copied into C7 by the percentage rate of inflation input in E4.
The formula in C8 is copied into cells C9 to C16 to model the effect of
inflation over 10 years.
The information output from the model is the price adjusted for inflation
over a ten-year span. This can be used, for example, to predict the price
of goods worth £1000 in 2010 in ten years time (see Figure 5.22). It can
also be used to work out the likely price of goods today if the price in a
previous year is known.
This simple model has some significant limitations. The model uses the
average inflation figure over a ten-year period. However, inflation will rise
and fall, and so the actual price each year may fluctuate considerably from
that shown in the model. However, over a ten-year period, the model may
adequately represent the overall trend in price inflation.
121
122
Exercise 5.12
Testing a model
A model is based on rules which attempt to describe the real-world
situation that the model represents. These rules should be tested in the
way that any ICT system is tested (see Chapter 11) and the examples of
spreadsheet models given in this chapter should be tested in this way.
In addition, because a model is intended to mimic a real-world situation,
it should be tested against this situation to see if it does make accurate
predictions. For example, in the supermarket queue model, the average
waiting time for customers should be manually measured using
stopwatches and the results compared to the predictions of the model.
This comparison is likely to show whether the rules built into the
model are reasonable. A likely finding is that the measured average
waiting time is longer than that predicted by the model. This is because
the model assumes that customers distribute themselves evenly
between the checkouts that are open; in the real world, customers do not
do this.
The supermarket manager could respond to this information in various
ways:
• accepting the model, as the difference in average waiting time results
from customers’ choices and could be minimal
• introducing ways of managing the queues of customers so that they
distribute themselves evenly between checkouts
• changing the rules built into the model to make it more accurate.
123
Exercise 5.13
1. A student receives an allowance of $50.00 a week. This is how the student spends the money each day.
Monday Tuesday Wednesday Thursday Friday
Travelling 4 4 4 4 4
Lunch 2 3 2 4 6
Snacks 3 2 1 2 2
Games World 10 9 5 6 10
124
h) Change the rate of pay for unskilled workers from $20 to $25 and for skilled workers from $30 to $40.
i) Save the spreadsheet as ‘July wages 2’.
j) The employees want more pay. The owner can afford to pay $40 000 in wages each month. Use the
model to find what rate of pay the owner should offer employees.
125
126
12. Formatting enables you to control the appearance of cells and the
spreadsheet in general. Formatting includes the following:
• Alignment of cells (left, centre or right)
• Representation of numbers (general, number, currency,
accounting)
• Changing the column width and row height, and adding
borders and patterns.
13. You can sort data into ascending or descending order according
to the content of one or more fields.
14. Data can be represented using a wide range of different types of
graphs; for example, line graphs and pie charts. In Excel, select
the data range that you want to use to create the graph and then
use the Charts options on the Insert tab of the Ribbon.
15. You can cut or copy and paste graphs or part of a worksheet to a
word processor for including in a report.
16. Spreadsheets can have multiple worksheets within them. The
active worksheet is displayed on the screen; however, other
worksheets may be hidden behind it. A worksheet can be
displayed by clicking on its name tab, and doing this makes the
worksheet the active worksheet.
17. Multiple worksheets can be used to hide complex data and
calculations so that the user is presented with a simplified
summary. This feature is very useful in modelling.
• You can rename a worksheet: right-click on the worksheet tab,
select Rename, and type in the new name.
• Look-up tables are particularly useful when used with multiple
worksheets within a spreadsheet. You can store information on
one worksheet and refer to it in another; and you can use the
results calculated in one worksheet as part of a calculation in
another worksheet.
• Cell references in one worksheet can refer to another
worksheet so that the data in one worksheet can be used in
another. In Excel, to refer to cell A3 in Sheet1 when you are
working in Sheet 2, you would write the cell reference like this:
Sheet1!A3.
18. A model is a representation of the real world. Models are used to
improve understanding of a real system, to solve a problem, or
to predict what will happen. It is important to remember that a
model is only a representation of the real world; it is not the real
world. Models are used so that you can learn about an unfamiliar
situation and experiment without danger or expense.
19. Models can be constructed using a spreadsheet. This involves
deciding on the input variables, how the rules will be expressed as
formulae, and the information that will be output. Spreadsheet
models can help us understand a situation, but they are often
very restricted in scope and it is important to take this into
account when making decisions based on the results.
127 127