0% found this document useful (0 votes)
4 views

COMP 102 2025 - Lecture Five

The document outlines the COMP 102 course on computer skills fundamentals, focusing on using formulas and functions in Microsoft Excel 2013. It covers the structure of formulas, the difference between formulas and functions, cell references, and the order of operations in calculations. Additionally, it discusses named ranges and their advantages in simplifying spreadsheet management.

Uploaded by

theotjituaiza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

COMP 102 2025 - Lecture Five

The document outlines the COMP 102 course on computer skills fundamentals, focusing on using formulas and functions in Microsoft Excel 2013. It covers the structure of formulas, the difference between formulas and functions, cell references, and the order of operations in calculations. Additionally, it discusses named ranges and their advantages in simplifying spreadsheet management.

Uploaded by

theotjituaiza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 45

COMP 102

COMPUTER SKILLS FUNDAMENTALS II


Dr. Malatsi GALANI
DEPARTMENT OF BIOMETRY AND MATHEMATICS

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

Version - Microsoft Excel 2013


Lecture Outline
1. Introduction Functions in
Excel
2. How to work with Formula
3. Functions operations and its
usage
4. Cell references
5. Lecture recaps
Introduction
In Excel, formulas allow users to make new calculations based
on data entered into a spreadsheet.
The following should be considered when creating a spreadsheet:
• Which terms are data/numbers that you will type?
• What terms are data/numbers will you calculate from the
data?
• Which numbers are constant and are to be used in a variety
of calculations?
• What arrangement of the columns and rows will make it
easiest for you and your intended audience to work with the
spreadsheet?
Formulas and Functions
The ability to perform calculations is one of the purposes of using
a spreadsheet application.
Some examples of the types of calculations that can be done
are:
• Totals, Subtotals, Averages, Sum, Standard deviation
etc….
In Excel, the calculation can be specified using either a formula
or a function.
• Formulas are self-defined instructions for performing
calculations.
• In contrast, functions are pre-defined formulas that come
with Excel.
Formulas
In simple terms a formula is made up of a
combination of numbers, cell references and
mathematical operators.
Excel uses standard operators for formulas, such as ;
• plus sign for addition (+),
• minus sign for subtraction (-),
• asterisk for multiplication (*),
• forward slash for division (/),
• caret (^) for exponents.
Formulas
All formulas in Excel must begin with an equals sign (=).

This is because the cell contains, or is equal to, the formula and the
value it calculates.

Arithmetic formulas are by far the most common type of formula


used in Excel.

 Formulas are the hallmark that makes spreadsheets so popular


Formulas Structure
All Excel formulas have the same general structure: an equal sign
(=)

Followed by one or more operands, which can be values, cell


references, ranges, range names, or function names,

Separated by one or more operators, which are symbols that


combine the operands in some way, such as the plus sign (+) and the
greater-than sign (>).
Formula –
Execution
The calculation is executed immediately after the formula is
typed into the cell and entered by pressing either the Enter or
Tab key or by clicking the checkmark in the formula bar.

What happens if you enter the formula without the leading equal
sign ’=’ into a cell?

• REMEMBER: All Formulas and functions must begin with a ‘=‘.


• The text of the formula or function will be displayed in the cell
if you do not use an ’=’ and the calculation will not be
executed.
Formula Cell Reference
While you can create simple formulas in Excel manually
(for example, =2+2 or =5*5), most of the time you will
use cell addresses to create a formula.

This is known as making a cell reference.

Using cell references will ensure that your formulas are


always accurate because you can change the value
of referenced cells without having to rewrite the
formula.
Formula Cell Reference
By combining a mathematical operator with cell references, you
can create a variety of simple formulas in Excel.

Formulas can also include a combination of cell references and


numbers

In summary, if automatic calculation is activated, Excel


automatically recalculates the result of any formulas as cell
entries change.
Automatic calculation also applies to functions.
Formula Cell
Reference
Excel Functions
 A function is a predefined formula that performs
calculations using specific values in a particular order.

Functions perform calculations by using specific values,


called arguments, in a particular order called syntax.

Functions differ from regular Formulas in that, after the


equal sign, you enter the cell addresses but not with the
arithmetic operators.
Excel Functions
 When creating a function in Excel you must first have
the data that you wish to perform the function with
selected.

Functions perform calculations by using specific


values, called arguments, in a particular order called
syntax.

Functions differ from regular Formulas in that, after


the equal sign, you enter the cell addresses but not with
Commonly Used Functions
Excel has a variety of functions available. Here are some of the most
common functions.

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.

AVERAGE: This function determines the average of the values included


in the argument.
• It calculates the sum of the cells and then divides that value by the
number of cells in the argument.
Commonly Used Functions
COUNT: This function counts the number of cells with numerical
data in the argument. This function is useful for quickly counting
items in a cell range.

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)

In the above function:

 The equal sign begins the function.


 SUM is the name of the function.
 B2 and C2 are the arguments/cell references.
 Parentheses enclose all of the arguments.
 Commas separate the arguments
Entering Functions
There are hundreds of functions in Excel, but only some will be
useful for the type of data you're working with.

A great place to explore functions is in the Function Library on


the Formulas tab.

Here, you can search and select Excel functions based on


categories such as Financial, Logical, Text, and Date & Time.
Reference Operators
Refer to a cell or a group of cells.

There are three main types of reference operators will only


concentrate on two:
Range:
 Refers to all of the cells between and including the reference.
 Consists of two cell addresses separated by a colon.
 EXAMPLE: ’A1:A3’ includes cells A1, A2, and A3.
 EXAMPLE: ’A1:C3’ includes cells A1, A2, A3, B1, B2, B3, C1,
C2, and C3.
Reference Operators
Union:
 Includes two or more references.
 Consists of two or more cell addresses separated by a comma.
 EXAMPLE: ’A7, B8, C9’ refers to cells A7, B8, and C9.
 EXAMPLE: ’A7, B8:D9, E4’ refers to cells A7, B8, B9, C8, C9, D8, D9 and
E4.

 In the example function, we used a union reference when we typed


‘=AVERAGE(B2,C2)’, but we could have used a range reference instead:
‘=AVERAGE(B2:C2)’.
Using a Function instead of a

Formula
Functions can be a more efficient way of performing mathematical
operations than Formulas.

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.

Using cell references is also important when you copy a formula or


function.

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:

 Relative cell reference.


 Absolute cell reference.
 Mixed cell reference.
Relative Cell Reference
A reference to a cell like =A1 is considered relative because if the position
of the cell that contains the formula is moved, the reference changes as
well.

When Formulas or functions containing relative cell referencing are copied


from one cell to another, Excel does not create an exact copy of the formula
or function.

Changes when a formula is copied to another cell relative to the rows and
columns they are moved to.

By default, all cell references are relative references.


Relative Cell Reference
Relative references are especially convenient whenever you need
to repeat the same calculation across multiple rows or columns.

 EXAMPLE: If a simple addition formula of ‘=A1+B1’ in cell C1 is


copied to cell C2, the formula would change to ‘=A2+B2’ to reflect
the new row.

 EXAMPLE: If a simple average function of ‘=AVERAGE(B2:B5)’ in


cell B6 is copied to cell C6, the function would change to
‘=AVERAGE(C2:C5)’ to reflect the new column.
Absolute Cell Reference
An absolute cell reference refers to the same cell, no matter where the formula or function
is copied.

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.

An absolute reference does not change.

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

=$A1 The column is absolute; the row is


relative
=A$1 The column is relative; the row is
absolute
=$A$1 Complete absolute 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.

To convert relative cell references to absolute or mixed cell references:


 Press F4 once to create a cell reference fully absolute such as $A$6.
 Press F4 a second time to create a mixed reference where the row
number is absolute such as A$6.
 Press F4 a third time to create a mixed reference where the column
letter is absolute such as $A6.
 Press F4 a fourth time to make the cell reference relative again such as
A6.
Order of Operations
A complex formula can be defined manually or by combining multiple
functions into a complex formula using the mentioned standard arithmetic
operators.

When you perform calculations in Excel, be careful of precedence.

A single formula can produce multiple answers, depending on the order in


which you perform the calculations.

This order of precedence enables Excel to calculate a formula


unambiguously by determining which part of the formula it calculates first,
which part second, and so on.
Order of Operations
Excel follows the standard order of operations when it performs all
calculations (PEMDAS):

1.Parentheses: Computations enclosed in parentheses are performed


first.
2.Exponents: Computations involving exponents are performed next.
3.Multiplication and Division: Performed in the order in which they
occur (from left to right).
4.Addition and Subtraction: Performed in the order in which they occur
(left to right).

Calculations are performed from left to right, with multiplication and


divisions performed before addition and subtraction.
Named Ranges Formulas and Functions

When you are working with a large spreadsheet


you can name a range of cells and use the name
in Formulas or functions.

When you create Named Ranges in Excel, you


can use these Names instead of the cell
references.
Naming a Range
To name a range, select the cells to be included in the
range, and then type a name in the Name Box located
above the worksheet.

Recall, the Name Box normally contains the address of


the current cell.
You can also name a range, select the cells to be
included in the range, right-click on the selection, type
the name in the dialogue box that appears, and then
click OK.
For example, you can use SUM(SALES) instead of SUM(C2:C13) for the above data set.
Named Ranges -
Rules
Although Excel is flexible about the names that you can define, it does have the following
rules:

A. Names must begin with a letter or the underscore character (_).


B. Names can't contain any spaces. You may want to use an underscore or a period
character to simulate a space (such as Annual_Total or Annual.Total).
C. You can use any combination of letters and numbers, but the name must not begin
with a number (such as 3rdQuarter) or look like a cell reference (such as Q3, TRY123).
D. You can't use most symbols. You can, however, use the underscore (_), period (.),
backslash (\), and question mark (?)
E. Names can be no more than 255 characters long.
Named Ranges - Advantage
A meaningful range name (such as Income) is much easier to remember than a
range address (such as A1:A21).
After you select a named cell or range, its name appears in the name box.
You can quickly move to a named area of your worksheet by choosing a name
in the name box.
Creating formulas is easier because you can paste a cell or range name into a
formula.
Names make your formulas more understandable and easier to use. For
example, =Income-Taxes is more intuitive than =D20-D40.
Error Indicators
• The Little Green Triangle in the Cell
• Excel will display a small green triangle in the upper left corner of cells containing
error values.
• The green triangle indicates that the cell's contents violate one of Excel’s error-
checking rules.
• Clicking on a cell containing a green triangle will cause a yellow diamond-shaped
button to appear next to the triangle.
• The yellow diamond is Excel's error options button and it contains options for
correcting the perceived error.
• Hovering the mouse pointer over the error options button will display a text
message - known as hover text - that explains the reason for the error value.
Common Error Values
Common Error Values
• ##### error
• The column isn't wide enough to display the value.
• Widen the affected cell by widening the column
• #NAME? error
• Excel tries to interpret the text as a cell reference, a range name, or a function
name.
• When it can't recognize the text as any of those things, it displays this error value
• #VALUE! error
• A formula has the wrong type of argument or function or operand.
• The most common cause for this error value is a reference to text by a numeric
operation.
Common Error Values
• #NULL! error
• occurs when two or more cell references are separated incorrectly or unintentionally by a
space in a formula.
• #DIV/0! error
• Excel displays the #DIV/0! error when a formula tries to divide a number by 0 or an empty
cell.
• Check that the correct cell references were used in the formula.
• #REF! error
• A cell reference is invalid.
• Most likely, referring to a deleted cell. For instance, the expression =A1+B1 won't return an
error if you delete the value in B1. But if you delete column B, it will.
• #NUM! error
• A formula has invalid numeric data for the type of operation.
Any Questions
Next week’s lecture covers Problem-Solving Concepts
and Principles in MS Excel

©2023 Mphago B. Botswana International University of Science and Technology 45

You might also like