7 Cell referencing

Cell referencing
Ribbon groups used
These can all be found on the Home ribbon.
Types of cell referencing
• There are two different ways of referencing a
particular cell in a formula: relative and
absolute.
• A car import project will be used to
demonstrate their different uses.
Relative cell referencing
• This is the default setting in Excel.
• In this example, =A1 has been entered into
cell B4. When it is copied to cell C4 the
formula becomes =B1, because B1 is the cell 3
above and 1 to the left of cell C4!
Absolute cell referencing
• This is used when you always want to refer to
the same cell.
• Open a new workbook. Copy the data entering
all the cell contents and replicating the
formatting.
• First you need to enter a formula to calculate
the price of the imported cars in pounds. The
price will be calculated using the current
exchange rate which is entered at the top of
the worksheet.
• Click cell D6 and enter the formula =C6/B2. To
convert Euros to pounds, you need to divide
the euro amount by the exchange rate). Press
Enter.
• Copy the formula down to D12.
What happened?
• Can you remember what the error values
mean?
• Excel has automatically used relative cell
referencing.
• We need to use an absolute cell reference as
the formula need to always refer to cell B2,
where the exchange rate is.
• Delete the contents of cells D6 to D12.
• Click in cell D6 and re-enter the formula,
making B2 an absolute cell reference.
• Change the formula to =C6/$B$2 and copy the
formula down to cell D12.
For absolute cell referencing, all you need to do is
add a $ symbol in front of the column letter AND row
number. You can put the symbol in front of the
column only, but this will mean that when you copy a
formula, only the column part of the formula will be
kept constant. This is called mixed cell referencing.
• Change the imported price (pounds) to display two
decimal places and save your work as Cars.
Entering and checking formulae
• You need to enter a formula for the £Saving
column.
• Use a formula to calculate
UK price (pounds) – Imported price (pounds)
• Copy the formula down.
• Check that the results look correct.
Question: Do you need relative or absolute cell
referencing for this?
• The spreadsheet should look like this:
• Tip: If you want to check
for formula errors, click the
error checking button in the
Formula Auditing group on
the Formulas ribbon.
Calculating a percentage
• You will now include formulae in the %Saving
column.
• Use a formula to calculate
£Saving/UK price (pounds)
• Format the cells to show two decimal places.
• Copy the formula down for all the cars.
• Select cells F6 to F12 and click the Percent Style
button in the Number group on the Home
ribbon.
• Now change the exchange rate in cell B2. At what
exchange rate does the %Saving become zero for
the Mini?
The currency format
• The table will look better if the prices were
displayed with currency symbols.
• Select cells B6 to B12 and
right-click to bring up the
shortcut menu.
• Select Format cells...
• Select the Number tab and
Currency from the Category:
list. Set the Decimal places to 0.
Starter
Annotate your worksheet to explain what each of the buttons are used for
(use your own words to help you revise).
Tip: Hovering over the buttons in Excel will help if you are unsure.
• Excel should choose the £ symbol by default.
• Click OK.
• Repeat this for the euro column. Remember
to use the euro symbol from the Symbol list.
• Format all other currency columns correctly.
Merge and centre cell contents
• Type UK Price in cell B4 and Imported Price
into cell C4. Make them bold.
• Replace the contents of cells B5 and D5 with
Price in pounds and the content of cell C5
with Price in euros. Format this text as bold
and aligned right.
• Select cells C4 and D4. Click the Merge &
Center button.
Adding a date field
• A quick way to enter today’s date is to press
Ctrl+; together. Alternatively, you can type a
date (separated with either hyphens or
forward slashes)
• Add the text Updated into cell D2. Make it
bold and right-aligned.
• Add the date into cell E2.
• Right-click in the date field and select Format
Cells...
Excel has
already guessed
that you want
the Date
category. Pick a
Type: from the
right-hand list.
You may need to
widen column E
to display the
whole date.
Make sure that this displays English (United
Kingdom) as some countries express dates in
different formats.
Wrapping cell content
• Select cell A11, and click the Wrap Text button in
the Alignment group on the Home ribbon.
• Now resize column A so that it is too small to fit
all of the words on one line (be careful to make
sure that the contents of A6 is still visible).
• If the row height does not automatically adjust,
increase it for row 11 by clicking and dragging
between the row headers of row 11 and 12.
• Repeat this for some of the other cells where the
Car make & model description is long.
• Now make the column headings in row 5 and the
contents of cell C2 wrap over two lines.
Finding a cell that contains a particular
word or value
• Click Find & Select in the Editing group
on the Home tab.
• Select Find... and type VW in the Find what...
box.
• Click the Find Next
button. Excel will
indicate the cells
which contain VW.
Replacing a word or value
• If you have spelt a name wrongly or wish to
change it, it is useful to find and replace each
instance of the word in one go.
• We will replace VW with Volkswagen.
• Click Find & Select in the Editing group
on the Home tab.
• Select the Replace... option on the menu to
display the Find and Replace dialogue box on
the Replace tab.
• Check that VW is still showing in the Find what: box,
and type Volkswagen in the Replace with: box.
• Click the Replace All button.
• Click OK. You will notice
that VW has now become
Volkswagen.
• Click Close.
Adding headers and footers
• Open the Page
Setup dialogue
box.
• Select the
Header/Footer
tab.
• Click Custom
Header
Change the
text to Arial,
size 12 and
bold.
• Type the title into the centre section.
• Select the text and click the Format Text button.
• In the footer section:
You will need to add spaces, commas and the word
‘of’ as shown in the example.
The print preview
of the worksheet
should look
something like
this.
Exercise 5
• Work independently.
• Remember that you can always use the Help
function if you get stuck.
Name:
Date:
Progress checklist 7
• Do I know the difference between relative and absolute cell
referencing?
• Do I know how to insert absolute addressing into a spreadsheet
cell?
• Can I calculate a percentage using a spreadsheet?
• Can I format cells to currency?
• Do I know how to merge and centre cells?
• Do I know how to apply wrapping to cell content?
• Can I add borders to cells?
• Can I find a replace text?
• Can I add headers and footers?
• Can I insert fields into headers and footers?