Professional Documents
Culture Documents
ENGG1801 Engineering Computing: Lecture 1-2 Excel Basics
ENGG1801 Engineering Computing: Lecture 1-2 Excel Basics
Engineering Computing
Lecture 1-2
Excel Basics
Semester 1, 2017
School of Information Technologies
The University of Sydney, Australia
sydney.edu.au/engineering/it/courses/engg1801
Jason Chan
j.chan@sydney.edu.au
ENGG1801 Engineering Computing 1
Jason Chan
Semester 1, 2017 Schedule
Week Date Lecture topics Notice
1 6 – 10 Mar Introduction, Excel basics
Part 1 –
Excel
• Excel Basics
– How to use Excel to do the simplest things
– How to solve some substantial problems
using Excel
http://www.bricklin.com
http://www.bricklin.com
• C2: =A2+B2
• C3: =A3+B3
• C4: =A4+B4
• C5: =A5+B5
ENGG1801 Engineering Computing 17
Jason Chan
Copying to other cells
• Suppose we always want to use the same
cell A2 in different places (C2 to C5)
• So the correct formulas should be:
• C2: =A2+B2
• C3: =A2+B3
• C4: =A2+B4
• C5: =A2+B5
ENGG1801 Engineering Computing 18
Jason Chan
Copying to other cells
• But if we use relative referencing, then we
will get wrong results:
• C2: =A2+B2
• C3: =A3+B3
• C4: =A4+B4
• C5: =A5+B5
ENGG1801 Engineering Computing 19
Jason Chan
Copying to other cells
• We want row 2 of cell A2 in the formula
=A2+B2 to remain constant when we copy
the formula
• We put a $ sign
in front of the
row number so
that it doesn’t
change
• C2: =A$2+B2
ENGG1801 Engineering Computing 20
Jason Chan
Copying to other cells
• Now, when we copy the formula to other
cells, the 2 in A2 will not change
• This is called absolute referencing
• C2: =A$2+B2
• C3: =A$2+B3
• C4: =A$2+B4
• C5: =A$2+B5
ENGG1801 Engineering Computing 21
Jason Chan
Copying to other cells
• We can use a combination of relative and
absolute referencing
Cell What happens to cell
reference reference when copied
A2 Both row and column may change
A$2 Row 2 remains constant
$A2 Column A remains constant
$A$2 Row 2 and column A both remain constant
1 2
s ut at
2
1 2
s ut at
2
• Now we have
a problem
when there
aren’t 2 roots
(i.e.
discriminant ≤ 0)
ENGG1801 Engineering Computing 39
Jason Chan
Another Practical Example
• We want to do different things depending
on different conditions
– If there are 2 roots, we want one of them
displayed in D5
– But if there is
1 root or no
roots, we
want nothing
displayed in
D5
ENGG1801 Engineering Computing 40
Jason Chan
IF functions
• So we use an IF function:
=IF(disc>0, (-b–SQRT(disc))/(2*a), "")
• This means:
– If disc>0, then use (-b–SQRT(disc))/(2*a)
– If not disc>0, then use "" (nothing between
quotes means display nothing)
ENGG1801 Engineering Computing 41
Jason Chan
IF functions
• In our previous example, we no longer get
the #NUM! error when there are no roots
– disc = -20 ≤ 0, so "" (blank) is displayed
Displayed
Meaning
value
#DIV/0 Division by 0
#NAME? Undefined variable / function name
#N/A No value available
#NULL! A result has no value
#NUM! Numerical error (e.g. SQRT(-1))
#REF! Invalid cell reference
#VALUE! Invalid input type (e.g. SQRT("abc"))