Simple Functions

advertisement
Excel 2007
Relative/Absolute Cell Referencing and
Calculating with Simple Functions
Vivien Edwards, September 2010
It has been decided that each student is to be given an
extra mark of 20 to be added to their total. This has
been entered in cell C10 and is to be added to the totals
in column F to give each student a new total.
Cell Addressing
Relative Cell References
In the above worksheet, we have used the sum function
in cell F4 to calculate the total marks for Student A.
If we use the formula =F4+C10, when we copy the
formula down to the other rows references to both cells
F4 and C10 will increase by one row number, giving
F5+C11, F6+C12, etc (as shown below).
=SUM(B4:E4)
This instructs Excel to add the contents of all the cells
in the range beginning with B4 and ending with E4.
We may now copy this instruction to the Total cells for
the other students, either by using the fill handle or by
using copy and paste. If we then check the formula in
these other cells we will see the following
As cells C11, C12, C13 and C14 do not contain a value,
then the formula will add zero to the total in column F
on these rows. However, we can ‘fix’ cell C10 in the
formula so that it stays in its original position, no
matter where we copy the formula to.
Excel has copied the format of the instruction, but has
changed the cell references relative to how many cells
the formula has been moved from its original position.
In this case, the row number has increased by one for
each row down the formula has been copied to.
We do this by giving it an absolute cell reference, this
is achieved by using a dollar sign ($) before each part
of the cell reference. In our calculation we would use
the formula
When we use this form of identifying cells we are
giving them relative references.
=F4+$C$10
Absolute Cell References
When this formula is copied down to rows 5, 6, 7 and 8
the reference to cell C10 stays as C10.
The following example illustrates a case when using
relative cell references would be inappropriate, for
example when we wish to include a value that appears
in one cell only in a calculation that is to be copied to
many other cells.
ICT Learning
1
v_E07_03/1
A useful shortcut to apply the dollar signs is to key in
the cell reference in the normal manner, ie C10, and
then to immediately press the Function 4 (F4) key on
the very top row of the keyboard. This will place dollar
signs before the C and before the 10.
Other Simple Functions
MAX
Returns the maximum value
MIN
Returns the minimum value
COUNT
There are occasions when we need to ‘fix’ only the
column or the row, in these cases we need to only use
the dollar sign before the part of the reference we want
to remain static.
Counts the number of cells in the range
that hold a value
COUNTA
Counts the number of cells in the range
that are not blank
$D23
the column will always be D, but the row
number will increase
All functions may be keyed in or inserted from a
‘library’ of functions.
D$23
The column will increase but the row will
always be 23
Mixed Cell References
To use the Function Library
1.
Simple Functions
Make the cell where the answer is to appear the
active cell.
2. Click on the Formulas tab to show that ribbon
3. In the Function Library, click on the Recently Used
button then on Average within the drop down list.
Excel offers a range of built-in equations called
functions to carry out calculations, alter the
appearance of text, ask logical questions and so on.
The Sum function (eg =SUM(B4:E4) is probably the
most commonly used and most familiar function.
The sum function is made up as follows
=
To let Excel know it is a calculation
SUM
The name of the function
(B4:E4)
The argument, or range of cells
4. Check the range of cells offered in the Number 1
box of the Function Arguments dialog box is
correct, if not, change the cell references. Click on
OK.
Average
Using the previous example, let us now calculate the
average mark for each module.
Alternatively
1.
Click on the Insert Function button at the left end
of the formula bar.
2. In the Insert Function dialog box, select the
function you require
3. Follow the steps above for the Function Arguments
dialog box.
We want to place the average mark for Module 1 in cell
B10. Make this cell active, then key in
=AVERAGE(B4:B8) and hit Enter
The answer 61 should appear.
ICT Learning
2
v_E07_03/1
Download