Spreadsheets One - Computing Science and Mathematics

PDM9L6 - INFORMATION TECHNOLOGY SKILLS
SPREADSHEETS 1: INTRODUCTION TO EXCEL
PDM9L6
SPREADSHEETS 1: INTRODUCTION TO EXCEL
LEARNING OUTCOMES
By the end of this workshop, students should be able to:
 Start Microsoft Excel.
 Enter labels, data and formulas in a spreadsheet.
 Select and format cells and groups of cells.
 Use relative, absolute and mixed addressing.
 Define names for cells in spreadsheets.
 Format cells.
 Construct spreadsheets to solve simple problems.
TRANSFERABLE SKILLS
The ability to use spreadsheets as a tool for general problem solving and ‘what-if’ style
calculations
Remember to register your attendance
Remember to check your student email
Remember to check out the PDM9L6 web pages for any news and
announcements
SO WHAT IS A SPREADSHEET?
A spreadsheet is a computerised ledger for recording data in a tabular arrangement of cells
and performing calculations on that data. Basically, you can use a spreadsheet to perform all
sorts of useful tasks involving numerical data, with the added facilities of a word processor,
such as, cut-and-paste, formatting, etc. Each cell in a spreadsheet can contain numbers, text,
formulas or built-in functions.
The spreadsheet package we will use is Microsoft Excel, part of the MS Office suite. In
addition to basic spreadsheet capabilities, Excel offers the user sophisticated formatting and
updating facilities. Imagine preparing a financial projection or a table of student assignment
marks containing totals or averages, only to discover you had made a simple arithmetic
mistake affecting all your results. Even if you were using a word processor, you might have to
retype large amounts of data. Using a spreadsheet, however, you could correct the mistake
and any results would be immediately updated! Does this sound too good to be true? Read
on…
Spreadsheet Basics
» Start Excel: Double click on the Microsoft Excel icon on the desktop or find it via
the Start menu. You will be presented with a new workbook entitled Book 1.
Microsoft Excel calls each single set of spreadsheets a workbook and, perhaps
confusingly, refers to spreadsheets as worksheets.
COMPUTING SCIENCE & MATHEMATICS
PAGE 1 OF 15
PDM9L6 - INFORMATION TECHNOLOGY SKILLS
SPREADSHEETS 1: INTRODUCTION TO EXCEL
Anatomy of a Spreadsheet
Moving Around the Workbook
When you open Excel, your first spreadsheet is automatically opened for you. The active cell
(i.e. the currently selected one) will be A1, at the top left corner of the worksheet. You can
tell this either by looking at the spreadsheet grid (note that cell A1 has a darker outline) or by
looking at the name box, or active cell address (immediately above the grid on the left-hand
side)
.
Each cell in the worksheet is referred to by its position within the grid. The
columns are denoted by letters in alphabetical order while the rows are denoted
by ascending numbers. The top left cell is A1; the cell to the right of it is A2;
the cell below it is B1, etc. Columns use all the letters of the alphabet including
the potentially confusing I and O. The columns to the right of column Z are AA,
AB, AC, …, AZ, BA, BB, BC, …, etc. The bottom right cell is IV65536, which by
my calculation means that there are … almost certainly enough cells!
To enter something in a cell you simply click on it (select it) and start typing. If the cell you
want lies beyond the current screen display, the page can be scrolled using the scroll bars.
You will soon find other ways of moving around the spreadsheet (for example, try the arrow
keys). If you want to find out more about this, you can use the help facilities that Excel
provides (see the Help section at the end of the worksheet).
COMPUTING SCIENCE & MATHEMATICS
PAGE 2 OF 15
PDM9L6 - INFORMATION TECHNOLOGY SKILLS
SPREADSHEETS 1: INTRODUCTION TO EXCEL
Entering Data
With Excel you can enter three main types of data into a cell:
 text (or labels). A label is text that you enter to make your spreadsheet more readable.
 numbers
 formulas
Pre-set functions are also available. We’ll come back to them much later.
» OK let’s actually do something! First close the task pane on the right (the bit with the New
workbook heading; we won’t be using it just now!
» Make sure cell A1 is the active
»
cell (if it’s not just click on it!)
and type in the text Weekly
Wages. What you are typing
will appear in the active cell
and in the input line.
active cell
Press the Return key.
input line
Look at the face of the workbook. It probably looks as though this label extends across
several cells, but it doesn't! If you look at the input line Excel shows you what is contained in
the active cell (i.e. the one that is highlighted). Cell A1 contains the whole label but if you
move to cell B1, you will see from the input line that it is empty. Let's improve the
appearance, however, by resizing column A.
» Move the mouse between the headers for column A and column B. The
cursor should change its appearance to indicate its new function. Click
and drag the cursor to stretch column A to accommodate the width of the
text.
» Move to cell A3, type Hours Worked and enter it.
To speed up the process, you can use the arrow keys to
confirm your entry and move to an adjacent cell
simultaneously. Clicking the green tick mark next to the
input line, or using the tab key are other ways of confirming
an entry. Remember, don't worry about making mistakes,
Excel also has an undo button! If only life had an undo
button!
» Enter Rate of Pay in A4 and Amount Paid in A5. So far, all we’ve entered is text. Next we
will enter some numbers.
» Enter the number 37.5 in B3
» Press the down arrow key
» Enter 5.65 in B4
» Press the down arrow again.
The active cell should now be B5. We want to calculate the result of multiplying B3 by B4
and put it in B5. How do we do this? We could:
a) Work it out using a calculator and enter the answer (only joking!), or…
b) Tell Excel to do it for us!
We need to enter a formula in cell B5. To tell Excel that you are entering a formula you must
first type an equals sign (=). When you enter the equals sign as the first character in a cell,
Excel will treat everything that follows as part of a formula. This has the advantage of
COMPUTING SCIENCE & MATHEMATICS
PAGE 3 OF 15
PDM9L6 - INFORMATION TECHNOLOGY SKILLS
SPREADSHEETS 1: INTRODUCTION TO EXCEL
allowing you to click on cells that you want to use in your formula instead of typing their
names directly.
» To illustrate this, make sure B5 is still the active cell and:

type in the = symbol,

then click on cell B3,

then type in the multiplication sign (*),

then click on cell B4.

Then press Return.
Do you get the idea? We are telling
Excel that we want cell B5 to
display the result of multiplying the
contents of cell B3 by the contents
of cell B4 whatever they are!
The value 211.875 appears on the
face of the workbook. (we'll sort the
format later). But note that the input
line shows the contents of the cell as
=B3*B4. You may have to select B5
again to see this.
You could just have typed in =37.5*5.65 but that's not much better than using a calculator;
the answer will always be the same. Here the cell contains the formula =B3*B4 and not the
value 211.875. If you move to cell B4 and change its contents to 5.8 (just type it in) you will
see that the value shown at cell B5 automatically changes to 217.5. This is an example of
automatic recalculation of formula. When the contents of a cell are changed, all cells, which
reference this cell in their formulas (either directly or through other formulas) are
recalculated. This is a Very Good Thing and it’s one of the things that make spreadsheets so
useful.
You could also just have typed in =B3*B4 (instead of clicking on the cells). This has the
same effect.
Editing Cell contents
The simplest way to edit the contents of a cell is to select the cell you want to change, re-type
the data and then press Return. This simply overwrites the previous contents of the cell. For
example
» Move to A1. Notice that the contents of the cell appear on the input line of the worksheet.
You can simply start typing to replace the entire contents of the cell with something else or,
more generally, click somewhere inside the input line and edit the text just as you would in a
Word document.
» Try it! Change the text to
Weekly Wage Calculator.
» Press Return.
» The corrected label Weekly
Wage Calculator should now
appear on the face of the
spreadsheet in cell A1. Resize the column to fit the contents again. (If you double click on the
divider between column A and column B, column A should be resized to accommodate the
text.)
COMPUTING SCIENCE & MATHEMATICS
PAGE 4 OF 15
PDM9L6 - INFORMATION TECHNOLOGY SKILLS
SPREADSHEETS 1: INTRODUCTION TO EXCEL
Working with a Range of Cells
Sometimes you may want to perform the same operation on a group of cells, for example, you
may want to delete the contents of a range of cells. Rather than dealing with each cell
individually, it is possible to select a group of cells and then perform the same operation on
all of them simultaneously. For example, we can delete the cells from A1 to B5 like this:
» Select the cells from A1 to B5. You can do
this by clicking and dragging the mouse from
A1 across and down to B5 (or by using the
arrow keys to move from A1 to B5 while
holding down the Shift key). The range of
cells between the initial selection point and
the current point will appear selected.
We usually denote a range of cells as A1:B5, that is, the top left cell and the bottom right
cell separated by a colon (:).
If you select the wrong range of cells, just try again.
» Having selected the range A1:B5, press the Delete key. All the contents of the cells in the
block should now have disappeared. If you do this sort of thing by mistake, how can you
undo your error?
» Yes, that's right, undo it now! (I wonder if the advertising slogan ‘Just undo it!’ would ever
catch on?)
Defining Cell Names
Using cell addresses (like A1, B9, Z24 etc.) for cell references, is very convenient, just like
grid squares on a map, but Excel allows you to define names for cells, which you can use in
formulas instead of cell references, if you choose. For example:
» Move to cell B3
» Select the Naming Box to the left of the input line. Type in “Hours_worked” as a cell
name.
» Press Return. Notice that the Naming Box (top left
corner next to the input line) now says Hours_worked
(instead of B3).
Remember, the cell A3 contains the text Hours worked, while the cell B3 is
named Hours_worked. Don’t get the two things confused and make sure it is B3
that you have given the name to and not A3.
» Now define names for B4 and B5 (remember to click on each one first). We suggest
Rate_of_pay and Amount_Paid as suitable names. The underscore characters are put in
instead of spaces because spaces are not allowed in cell names. We can now use these names
in the formula for calculating the total, like this:
» Move back to B5:
» Replace =B3*B4 with
=Hours_Worked*Rate_of_Pay. Do it the
smart way, build up the formula typing in the
= sign and the * sign, but entering the cell
names by just clicking on the cell to add it to the formula. Ask for help if you get stuck.
COMPUTING SCIENCE & MATHEMATICS
PAGE 5 OF 15
PDM9L6 - INFORMATION TECHNOLOGY SKILLS
SPREADSHEETS 1: INTRODUCTION TO EXCEL
» Press Return.
You can see the name of the cell B5 (Amount_Paid) and the names of the cells used to
calculate the contents of it (Hours_worked and Rate_of_pay).
When you give a cell name, the name belongs to that cell only, so using a cell name in a
formula means that we always are referring to that particular cell. Names are great if you
want fixed cell references, and also your formulas are a bit easier to understand. Sometimes
you need more flexibility when referencing a cell; we’ll see an example shortly.
Formatting Cells
We now want to improve the readability of the spreadsheet. There are various ways to
change the formatting. First, we will make the title stand out more (in the same way as you
would in Word)
» Move to A1
» Click on the Bold button from the Font panel on the Home tab.
» Make the Amount Paid label bold and italic.
Lovely!
There are also standard, frequently used, formats for which there are buttons on the Number
panel on the Home tab.
We’ll use these to format cells B3, B4 and B5, i.e. the range (B3:B5).
» Select B4 and B5
» Click on the currency speed button.
» Now select B3 and choose the arrow in the bottom-right
hand corner of the Number panel. Now you will be offered a
bewildering selection of different ways to format the chosen
cells. There are standard ones there, but you can customise
your own format too. We’ll do this for B3 so that it appears
as 37.5 hours.
» Select the Number tab if it is not already selected. Theen
select ‘More Number Formats’ from the list.
» Select Custom from the category list.
» Replace whatever is in the Type box with 0.0 “hours”.
Make sure you enter this exactly as shown. We are telling
Excel that we want this cell to be formatted such that it
displays numbers with one figure after the decimal point,
followed by a string of characters, consisting of a space followed by the word hours. If you
don’t get this right ask for help!
» Press OK
COMPUTING SCIENCE & MATHEMATICS
PAGE 6 OF 15
PDM9L6 - INFORMATION TECHNOLOGY SKILLS
SPREADSHEETS 1: INTRODUCTION TO EXCEL
NB: If you select the cell and look at the input line you will see that it only
contains the number 37.5 although on the face of the spreadsheet it is
displayed as 37.5 hours. This is NOT the same as typing 37.5 hours directly
into the cell. That would just be a cell containing a text label. What we have is
cell containing numeric data, which is formatted!
» To further illustrate this point try entering 37.5 hours directly into B3. Oh dear!
The #VALUE! indicator means that you’ve
tried to make a calculation on something which
is not a number. Clearly, you can’t add 23 to
abc. It just doesn’t make sense! That’s why we
use custom formats to make the spreadsheet
look nice while still allowing calculations to
work.
» Just undo the last step and all should be well
again.
Resizing Cells
» Try shrinking and stretching the width of columns A and B. Remember how?
You should see that Excel always tries its best to do something sensible. If you
shrink a column with text in it, the text will either appear to overlap blank
adjacent cells or will be truncated to fit the new size. Cells containing numeric
data, however, will display hash (#) symbols to warn you that the cell width is
insufficient to properly display the data. This is a Good Thing, since it prevents
you from misreading numeric data. Think about it!
Exercise
We are almost finished with this spreadsheet, so play around with the Format tools in the
Numbers panel for a minute or two. Try formatting individual cells or ranges of cells. We
will return to formatting spreadsheets later. Note that in the drop-down menu on the
Numbers panel, there are lots of pre-defined formats too. These might be useful for later
exercises …
COMPUTING SCIENCE & MATHEMATICS
PAGE 7 OF 15
PDM9L6 - INFORMATION TECHNOLOGY SKILLS
SPREADSHEETS 1: INTRODUCTION TO EXCEL
THE POWER OF SPREADSHEETS
Example 1
Spreadsheets are very useful for performing repetitive calculations very quickly and
accurately. In addition, they can be used to re-evaluate results based on different ‘what-if’
scenarios. This is a very powerful feature especially when combined with the facility to
replicate formulas over a range of cells. We must tackle one issue before we can truly unleash
the power, however, and that is how to move formulas around, known as replication.
Cell Addressing
There is no getting around the fact that this topic is a little tricky, so take your
time and try to understand each step rather than just following the
instructions.
To recap; if we type the formula =B3*B4 into cell B5, as we did in the Wages calculator
example, what does this actually mean? To illustrate the point, try this:
» Create a new spreadsheet by selecting File: New. Choose to open a new blank workbook in
the pane that appears.
That will give you a generic empty spreadsheet, (just like a new Word document in Word).
We are going to create a very simple loan repayment calculator (with apologies to any
independent financial advisers).
» Type in the adjacent text labels into the worksheet
and resize the columns to accommodate their
contents.
» After you have done this, enter 6.75% in B3, Excel
is smart enough to guess that you mean 6.75
percent.
» In A6, enter the value 1000 and format the cell as
currency.
In Cell Type in
A1
Loan Repayment Calculator
A3
Rate of Interest
A5
Amount Borrowed
B5
Total Repayable
C5
Monthly Repayment
» In B6, enter the formula =A6+A6*B3. This is just
the amount borrowed plus the annual interest (i.e. the amount borrowed multiplied by the
annual interest rate) to give the total amount repayable.
» In C6 enter the formula =B6/12 to give the monthly repayment over 12 months.
» In cell A7 enter the formula =A6+1000. This should result in the value £2,000.00 appearing
in A7 (including the currency formatting). The rest of column A, down to A20, should
contain £3,000, £4,000… and so on down to £15,000 in A20. We could type them all in by
hand but there’s a better way.
» Look at the selected cell; notice the bottom right
corner of the cell has a single black square (handle).
» Move the mouse over the handle until the cursor
changes to become a black cross. Now click and
drag down all the way to cell A20. Release the mouse
button.
COMPUTING SCIENCE & MATHEMATICS
PAGE 8 OF 15
PDM9L6 - INFORMATION TECHNOLOGY SKILLS
SPREADSHEETS 1: INTRODUCTION TO EXCEL
With a bit of luck the desired series of numbers, correctly formatted, should be filled in and, if
you click on each of the cells in turn, it should be apparent that Excel has replicated the
formula from one cell to another.
To put it another way, the contents of each cell is equal to the value from the cell immediately
above plus 1000. Excel has copied the formula in a relative way. This is important (trust
me!). Look at the contents of the cells A7, A8, A9 and so on. Do you see how each cell has a
similar formula, but with the reference to the cell changed?
Let us proceed. Replicate the formula from B6 down to B20. Oh dear!!!!
Something has gone horribly wrong! To see what it is, look at the formula
in B7. Can you see what the problem is? Excel has replicated the formula
using relative cell references but the cell containing the interest rate (B3)
should have been fixed.
When we are moving formulas around, we need to be able to tell Excel
that sometimes we want cell references to be relative and sometimes we
want them to be fixed. In fact, we already know one way of making a
fixed cell reference. We can give the cell a name!
» Give the cell B3 the name Rate_of_Interest in the same way as we did in
the Wages Calculator example above (using the Naming box).
» Now redo the formula in B6. This time when you click on B3, the cell name should appear in
the formula.
» Try replicating the formula down to B20 again. The cell reference will remain fixed in the
formula when it is copied. Excellent.
So giving a cell a name means that when it is included in a formula it will remain
fixed when the formula is replicated. Using the cell reference in a formula means
that when the formula is replicated the cell reference will change relative to the
destination cell. If you understand this, you understand spreadsheets!
There is quicker and more flexible way of making a cell reference fixed, however. Try this…
» Move back to B6 and edit the formula (in the input line) so that the reference to
Rate_of_Interest becomes $B$3 that is, insert the cell reference with a dollar sign ($) in
front of the letter B and in front of the number 3. The formula should now read
=A6+A6*$B$3.
» Now replicate the formula down to B20. Does it look right? The results should be the same as
before with the cell name. If not ask for help.
» Replicate the formula in C6 down to C20. That should be straightforward!
» Save your spreadsheet as loan.xls.
To summarize: Cell references in formulas are treated as relative, by default.
To maintain the absolute (fixed) address of a cell in a formula, put the dollar
($) sign in front of both the column letter and the row number or give the cell a
name.
This last example illustrates the most important feature of using spreadsheets namely, using
formulas to perform calculations and moving those formulas around. Quite simply, if you can
get your head round this then you’ve got it sussed! Make sure you follow what we have just
done. Do it again if you want. Talk to a demonstrator to ensure you’ve got the idea.
COMPUTING SCIENCE & MATHEMATICS
PAGE 9 OF 15
PDM9L6 - INFORMATION TECHNOLOGY SKILLS
SPREADSHEETS 1: INTRODUCTION TO EXCEL
Example 2 - Times Table
Mixed addresses and cell formatting
» Open a new workbook. Insert the numbers 1 to 25 in cells A1:Y1 along the top.
There’s a quick way to do this kind of thing using Excel’s AutoFill feature. Just type in the
numbers 1 and 2 in cells A1 and B1 respectively, then select the same two cells and then
click and drag the fill handle across the remaining cells. Excel
Column headers
has guessed that what you want to do is to continue the pattern
1,2,3,4….
This can be a very useful feature but should be used with caution, as Excel may not always
guess the pattern correctly. Replicating a formula is a more reliable way of doing this kind
of thing.
» Reset the width of columns A:Y. Click and drag across the column headers and choose
Format button on the Cells panel. From the menu that appears, choose Column Width.
Give the columns a width of 3.
» Enter 2 in cell A2 and fill down the remaining cells A3:A25 to display the numbers 1 to 25 in
column A
What we now want to do is to fill each cell in the range A1: Y25 with the result of
multiplying the value at the left end of the row by the value at the top of the column.
There are two ways of doing this:
1. Work them out with a calculator and type them in. Let’s see, that’s 625 calculations at
about the rate of one calculation every 5 seconds, that’s 52 minutes plus interruptions.
2. Use a formula and replicate it (that should take about 30 seconds).
Hmmm! let’s try method 2:
» In cell B2 enter the formula =$A2*B$1. Notice the dollar sign only appears once in each cell
reference, in the first case in front of the letter A and in the second case in front of the number
1. This is not a mistake! It indicates that only the column or the row will be fixed as we
replicate the formula. This is called a mixed cell reference (not relative or fixed - a bit of
both!).
» Now replicate the formula along row 2 to
column Y and release the mouse but with the
row still selected, drag the fill handle down to
row 25.
Now the whole table should be filled in! If not,
then ask for help! Try clicking on a number of
different cells. Look at the formula on the input
line. It should always be the cell at the top of
the column multiplied by the cell on the far left.
The last little exercise is about as tricky as it
gets! The next couple of exercises will help to
make things clearer. But first...
COMPUTING SCIENCE & MATHEMATICS
PAGE 10 OF 15
PDM9L6 - INFORMATION TECHNOLOGY SKILLS
SPREADSHEETS 1: INTRODUCTION TO EXCEL
Formatting your Spreadsheet
»
Let’s clean it up a little, and make it look similar to the
example shown! First, we will resize the columns
Select columns A to Y by clicking and dragging across the
column headings and again choose Format from the Cells
panel on the Home tab. This time choose Auto Fit Column
Width. Excel automatically sets the width of each column
selected to fit its contents.
Let’s put some labels on the spreadsheet; to do that we will
have to add another row and column.
» Select row 1 by clicking on the Row 1 Indicator at the extreme left of row 1 and choose
Insert from the Cells panel. Choose Insert Sheet Rows. A new row will be inserted above
where row 1 was, so the old row 1 is now row 2!
» Select Column A and do the same as above, but this time choose Insert Sheet Columns. A
new column will be inserted to the left of where Column A was, so the old Column A is now
Column B!
For labels, we'll just use the numbers from the original top row and left column.
» Select cells B2 to B26. Choose Copy from the Clipboard panel.
» Move to cell A2. Choose Paste from the Clipboard panel.
Copy the values from B2:Z2 to B1:Z1 to make a new top row. Now let’s make the first row
and column bold.
» Select B1:Z1 and click on the bold button from the Font panel. Do the same for A2:A26.
» Resize Column A.
» Next, we will add some borders using the Borders tool on the Font panel
» Format your table so that the top row is underlined and the left column has a border down its
right side.
» If you can’t find all the options you want you can choose More Borders from the Borders
drop-down menu and use the options to customise the effect.
The border pane in the centre of the dialog will show a representation of the cells that you
have selected. The line pane allows you to choose a line style; just click on your chosen style
and then select which borders you would like turned on either by clicking inside the border
area or by using the buttons round it.
Let’s put some stripes on the spreadsheet to make it easier to read.
» Select Cells B2:B26 (just click and drag over them).
» Select the Color Fill button from the Font panel and choose a colour under the Theme
Colors heading. A pale colour is most suitable.
» Do the same for each alternate column.
To speed the process up, select one of the cells that you have just formatted, and
then double-click the format painter button found on the Clipboard panel.
Continue clicking and dragging over the cells you wish to format (i.e. each
alternate column). When you have finished using the format painter, click on it once again to
deselect it.
COMPUTING SCIENCE & MATHEMATICS
PAGE 11 OF 15
PDM9L6 - INFORMATION TECHNOLOGY SKILLS
SPREADSHEETS 1: INTRODUCTION TO EXCEL
Example Three – Acme Widget Company
You have just been appointed to the job of Head of Financial Planning for the Acme Widget
Company (it could happen!). Your first task is to see if the company is capable of making a
reasonable amount of profit.
(NB A solution is provided at the end of this exercise but I recommend that you try it on your
own first.)
Here are the facts that you will use as the basis for your financial analysis:
Raw Data
Material Costs


The raw materials required to construct a widget cost £50.
To make one widget consumes £3 worth of electricity and 50p worth of water.
Labour costs


It takes one person two hours to make one widget (using a widget-maker).
The gross labour costs are £4.65 per hour (dangerously close to the minimum wage!).
Capacity



The factory can hold, at most, 40 widget-making machines.
Each machine requires one (fully occupied) person to operate it.
Each person only operates one machine, and we assume that there are no other
employees.
Other running costs
The monthly local authority tax on the building is £2,000 and the rent is £5,500 per month.
Profit Margin
The sales price of a widget is set to be 25% above the material costs not including labour.
Assumptions
Assume that employees and the factory operate for 8 hours per day, 30 days a month (to
simplify calculations:
So, how can you use an Excel spreadsheet to help you in this task? To start you off there is a
template containing the raw data as detailed above.
» Copy the folder Excel Worksheet 1 from the Groups (V:) PDM9L6 folder to your own
home directory. Open your copy of the file widgets.xlsx. If you can’t find this file, or if the
file contains data different to that given above, then ask for help.
The Calculations
The best way to answer this question is to try to break the problem down into smaller steps
then work out a step at a time:
1. What is the materials cost of producing 1 widget?
2. How many widgets can one person produce in a month?
3. How much do those widgets cost to produce? (in terms of labour and materials)
4. How much do you sell the widgets for?
5. How much profit does that give? (Does it give a profit at all?)
6. How much profit for two people? How much for three? ... and so on to the maximum
number of people employed ...
When you’ve worked out the final step you should have a table showing how profit relates to
the number of people employed. Next session you’ll see how to make a chart to illustrate this.
This session you should ensure that your spreadsheet is clearly laid out, making appropriate
use of formulas, labels and formatting (there’s a bit about formatting at the end).
COMPUTING SCIENCE & MATHEMATICS
PAGE 12 OF 15
PDM9L6 - INFORMATION TECHNOLOGY SKILLS
SPREADSHEETS 1: INTRODUCTION TO EXCEL
General comments
Don’t be tempted to do calculations in your head and then fill in the result. The whole point
of spreadsheets is to use the spreadsheet to do the calculations. In a test situation it also
means that you won’t be displaying your ability to use the spreadsheet and you’ll lose marks.
Another common fault is to insert numbers directly into formulas, rather than using cell
references (e.g. in the sales price calculation, or in the number of widgets per month
calculation). Using actual values in your spreadsheet like that makes it less flexible; it’s much
harder to do “what if” calculations (i.e. change one value and see how that affects the rest).
Error values
Here are the most common error values, what they mean, and strategies for getting rid of
them.
#, ##, ###
and so on means the column isn’t wide enough to show the value you’ve
calculated. Resize the column using Format: Column: Autofit Selection.
#NAME!
means you’ve used a name that Excel doesn’t recognise. Check your spelling,
and if you’re sure that’s ok, then check the name is defined by looking at the
list which appears when you choose Insert: Name: Define.
#VALUE!
means you’ve tried to do a calculation with an inappropriate type. e.g. one of
the “numbers” you’re trying to add is actually a piece of text. Check your
references point to the cells you think they do, especially with names.
Note that when you select a named cell the name appears in the top right hand corner of the
spreadsheet. You can also check this using Insert: Name: Define as above; the actual cell
reference appears at the bottom of the window. If you’re sure that the references are correct
then check the contents of those cells; you may have added formatting as text rather than by
using the format cells option. When you select the cell referenced the contents appears in the
bar at the top.
The Solution
What is the materials cost of producing 1 widget?
Work out the raw materials plus the electricity costs plus the water costs.
 In cell A7 insert the label Total materials cost per widget
 In cell B7 insert the formula =SUM(B4:B6). We could have used B4+B5+B6 but there
are a large number of built-in functions available. We’ll have a look at some of the
more common ones next week.
How many widgets can one person produce in a month?
First of all, work out how many working hours there are in a month.
 In cell A16 put the label Hours per person per month
 In cell B16 put the formula =B14*B15. We could be fussy and use $B$14*$B$15, but
as long as we don’t want to replicate the formula to some other location, the relative
address will do!
Our final objective is to produce a table showing how the net profit of the company varies
with the number of people employed so…
 Add the following headings in cells A19:E19.
Employees


Production
Costs
Income
Profit
The first calculation is for one person only, so put the number 1 in A20. Now we can do
the rest of the calculations with respect to that one person. If you get the formulas
right at this stage then making the calculations for more employees is easy.
The Production (i.e. the total number of widgets produced) is the number of hours
worked per person multiplied by the number of people, divided by the number of
hours it takes to make one widget.
COMPUTING SCIENCE & MATHEMATICS
PAGE 13 OF 15
PDM9L6 - INFORMATION TECHNOLOGY SKILLS

SPREADSHEETS 1: INTRODUCTION TO EXCEL
Enter =(A20*$B$16)/$B$12 in cell B20. This should evaluate to 120 (i.e. each
employee can produce 120 widgets per month)
How much do those widgets cost to produce?
First, work out how much it costs to pay one person for a month.
 In A17 enter the label Monthly wages per person. This will be the rate per hour
times the number of hours per person per month, so:
 In B17 enter the formula =B16*B13. This should work out as 1,116.
Next work out the fixed running costs for the factory. Assume that these are the same no
matter how many widgets are produced or how many people are employed.
 Enter the label Total fixed costs in D6 and the formula =E4+E5 in E6. You should get
7,500.
So, the total production costs will be the material costs per widget (B7) multiplied by the
number of widgets produced (B20), plus the labour costs per person (B17) multiplied by by
the number of employees (A20 ), plus the fixed running costs (E6).
 Enter the formula =($B$7*B20)+($B$17*A20)+$E$6 in cell C20
How much do you sell the widgets for?
Selling price of individual widgets is the cost of materials (B7) plus profit margin (B8).
 Enter the label Selling price in cell A9
 Enter the formula =B7+B7*B8 in cell B9. This should be 66.88
Now we can work out the total income of the factory by multiplying the selling price of one
widget (B9) by the number of widgets produced (B20).
 Enter the formula =$B$9*B20 in D20. This should be 8,025.
How much profit does that give? (Does it give a profit at all?)
Profit is the total income minus the total costs.
 Enter the formula =D20-C20 in cell E20
The first “profit” will be negative (-7,011), meaning it is not viable to run the factory with
only one employee.
Notice that we've used relative and absolute addresses in the formulas. Think
about why some are one and some are the other! Some of you might think that
the relative addresses should really be mixed addresses and you'd be correct
but we can get away without doing this because we will only be replicating
formulas down columns and not across rows.
How much profit for two people? How much for three? ...
OK. You’ve done the calculations for one person but we want to know how the figures
change as the number of employees increases from 1 to 40.
 In cell A21 enter the formula =A20 + 1.
Now replicate this formula. Select A21 and move the cursor to the bottom right hand corner,
so that it changes to a little black cross. Click and drag down for 38 cells. That should give 1
to 40 in the Column A. We know 40 is the maximum number of machines, and our only
employees are widget machine operators.
» Next do the same for each of the other formulas in the row above, i.e. B20, C20, D20 and
E20. Select the formula, get the black cross, click and drag down. Alternatively, you could fill
down the whole row. Ask and we’ll show you how!
Now you should have exactly what was required namely, a spreadsheet showing profit versus
number of employees. If you get error values then you have probably missed out some of the
COMPUTING SCIENCE & MATHEMATICS
PAGE 14 OF 15
PDM9L6 - INFORMATION TECHNOLOGY SKILLS
»
SPREADSHEETS 1: INTRODUCTION TO EXCEL
“$” signs in the formulas. Do you understand the power of spreadsheets now? Try doing that
lot with a calculator!
Try changing some of the values; what if the profit margin changes to 35%? All the other
calculations change too. This is the beauty of spreadsheets. Once the formulas are all in the
spreadsheet they can be used over and over again with new data. You can’t do that with a
pencil and a bit of paper (well – not so easily anyway). Next session you’ll see how to make a
chart to illustrate the example graphically.
Formatting the Cells
» Use the currency speed button to quickly format relevant cells as currency. Use the custom
style for numbers to add “widgets” or “hours” after a value. Use shading to make certain
columns of the table stand out.
Conditional formatting
It is possible to apply cell formatting, which is conditional on the cell contents. To illustrate
this, select the range of cells E20:E59, that is, the column under the profit heading.
» Choose Conditional Formatting from the Styles panel. This will bring up the Conditional
formatting menu. Choose Highlight Cell Rules and then Less Than....
» In the dialogue that appears, enter 0 and
then choose a formatting action from the
drop-down list.
» Choose the Light Red Fill with Dark
Red Text option. This should cause any
negative values in the profit column to
appear in red and, what’s more, if you change, for example, the profit margin to 35% the
colour formatting of the profit column should be updated along with the recalculation of the
values.
Naming Cells
If we click on a cell to insert it into a formula and that cell has been given a name, then the
effect is the same as using a fixed or absolute address. The decision is yours; just decide
which is more to your liking.
» Save your spreadsheet: you’ll need it next week.
Checkpoint
At this point show your times table and your completed widget spreadsheets
to a tutor. Both spreadsheets must make correct use of formulas. The widgets
spreadsheet must show the cost of producing widgets for 1-40 employees.
Next Time
Next time, we’ll use spreadsheets to do charts & graphs (and see how to include them in
Word documents). We’ll also cover sorting data in a worksheet, and clever-yet-simple
functions like SUM() and AVERAGE().
Looking Ahead
There is one more spreadsheets worksheet, and the week after that there will be a class test on
Spreadsheets. This will involve carrying out some tasks in Excel. It’s an open book test, so
you can have your notes with you, BUT to give yourself a good chance of doing well in the
test you should make sure you are familiar with the material before you come. Do all of the
workshop exercises. Twice if necessary!
COMPUTING SCIENCE & MATHEMATICS
PAGE 15 OF 15