COMP 102 2025 - Lecture Five
COMP 102 2025 - Lecture Five
General Information
Lecturer: Malatsi GALANI
[[email protected]]
Online Resource: COMP 102 via EDUHUB
[Moodle]
Lab Practical: Starts 2nd Week
Please interrupt with questions at any time
Using Formulas in Excel
This is because the cell contains, or is equal to, the formula and the
value it calculates.
What happens if you enter the formula without the leading equal
sign ’=’ into a cell?
SUM: This function adds all of the values of the cells in the argument.
Most commonly used function to add, subtract, multiply, or divide
values in cells.
MAX: This function determines the highest cell value included in the
argument.
MIN: This function determines the lowest cell value included in the
argument.
Entering Functions
When using a function,
remember the following:
• Use an equal sign to begin the
function.
• Specify the function name.
• Enclose all of the function’s
arguments within parentheses.
• Use a comma to separate the
function’s individual arguments.
Entering Functions
= SUM(B2,C2)
Specifically, in many cases, a function will simplify Formulas that you can
type in manually, such as average or sum.
EXAMPLE: If you wanted to add the values of cells D1 through D10, you
could type the formula ‘=D1+D2+D3+D4+D5+D6+D7+D8+D9+D10’, or
a shorter way would be to use the SUM function and simply type
‘=SUM(D1:D10)’.
Using a Function instead of a
Formula
Cell References
The best way to construct a formula or a function is to use cell references
(i.e., use the cell addresses) instead of typing actual numbers.
This enables Excel to automatically update the results of the Formulas and
Functions when you change the values in the cells being referenced.
When you copy the formula or function, the cell addresses will be copied in
a particular way depending on how the cells are referenced.
Cell References
Excel records cell addresses in Formulas and
Functions in three different ways:
Changes when a formula is copied to another cell relative to the rows and
columns they are moved to.
If a formula or function containing an absolute cell reference is copied to a new location,
the cell reference is not adjusted it will still refer to the same cell or range.
To create an absolute cell reference, you will need to add dollar signs (‘$’) in front of both
the column and row identifiers for the cell referenced – this fixes the row AND column.
EXAMPLE: When the formula ‘=B7*$C$1’ is copied from cell C7 to cell C8, the relative
cell reference changes ‘B7’ to ‘B8’, but the ‘$C$1’ absolute cell reference remains
unchanged.
Absolute Cell Reference
To create an absolute cell reference, you will need to add dollar
signs (‘$’) in front of both the column and row identifiers for the
cell referenced – this fixes the row AND column.
EXAMPLE: When the formula ‘=B7*$C$1’ is copied from cell C7 to cell C8,
the relative cell reference changes ‘B7’ to ‘B8’, but the ‘$C$1’ absolute cell
reference remains unchanged.
An absolute cell reference is most often used when you want to
use a constant in a formula or function.
Absolute Cell Reference
Advantage of placing the constant in its own cell and using
an absolute cell reference:
Referencing the cell containing the constant in all the desired Formulas
and functions with an absolute cell reference allows you to change the
value of the constant in one cell,
All the Formulas and functions that are absolutely referencing the cell
will be automatically updated.
This is much better than typing the actual value of the constant into the
formulas or functions.
Mixed Cell Reference
One that is half relative and half absolute.
The absolute part - which is preceded by the dollar sign - does not
change when copied while the relative part does.
EXAMPLE: ‘=A$1 + $B2’, the row of cell A1 will not change and the
column of cell B2 will not change.
Mixed Cell Reference
Example Comment
=A1 Complete relative reference
In the formulas above, the reference $A1 and A$1 are mixed references. The
dollar sign prevents the column letter from changing but the row number, being
relative, changes to reflect the new location of the formula as it is copied.
Cell Reference
How to add the Dollar Signs – The easiest way to change cell
references from relative to absolute or mixed is to press the F4 key on the
keyboard.