0% found this document useful (0 votes)
24 views34 pages

Ceb201 - Lecture 3

This document provides an overview of a lecture on using functions in Excel, including cell addressing, matrices, and solving simultaneous equations. It discusses using relative, partial, and absolute cell addressing when copying formulas. It also reviews matrix operations like addition, subtraction, and multiplication. The document demonstrates creating matrices in Excel using defined names and performing operations on the matrices like adding a constant, subtracting a constant, and multiplying by a constant. The goal is to help students use Excel's worksheet functions to set up and solve simultaneous equations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views34 pages

Ceb201 - Lecture 3

This document provides an overview of a lecture on using functions in Excel, including cell addressing, matrices, and solving simultaneous equations. It discusses using relative, partial, and absolute cell addressing when copying formulas. It also reviews matrix operations like addition, subtraction, and multiplication. The document demonstrates creating matrices in Excel using defined names and performing operations on the matrices like adding a constant, subtracting a constant, and multiplying by a constant. The goal is to help students use Excel's worksheet functions to set up and solve simultaneous equations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

Telue Engineering Institute

Lecture #3
SECTION 1: USING FUNCTIONS, DECISION
FUNCTIONS, CHARTS
Topic 4: Using Excel’s Worksheet Functions
to Solve Simultaneous Equations
Objectives:
 Cell Addressing in Excel
+ Do Excel Tutorial Exercise 2 (Relative Addresses)
+ Do Excel Tutorial Exercise 7 (Absolute Addresses)

 Application of Cell Addressing – Matrix


Multiplication
 Revision on Matrices
 Excel Operations using Matrices
 The MMULT and MMINVERSE functions
 Solving Simultaneous Equations
Tutorial #2…

20*20 MULTIPLICATION TABLES


Tutorial #2…

SOLUTIONS TO QUADRATIC EQUATIONS


Another Equation Solver

o Completing the two above exercises should show you that, once a worksheet
has been setup to solve a problem, it may be used repeatedly for the same
type of problem but with different input values.

o For example, if you had one quadratic equation to solve, you don’t need to
design a worksheet to solve this one equation. But if you have a dozen or so
equations, then a worksheet solution would be much more efficient than
using your scientific calculator!

o The Other advantages of using Worksheets when doing such calculations are:

i. The Ability to See, always, What Values You have Used


ii. The Facility to Modify the Calculation without Re-entering all the Data
In this exercise, we will design a worksheet to compute the effective resistance of 3
resistors in parallel.
The 3 Resistors (R1 = 3.00, R2 = 6.00, R3 = 9.00) have the equivalent resistance
value of the singe resistor (Re) whose value can be determined by the relationship
shown here:

• Given a Problem
• Use What You Know

𝑅𝑒

1 1 1 1
= + +
𝑅𝑒𝑡 𝑅1 𝑅2 𝑅3

1
𝑅𝑒 =
𝑅𝑒𝑡
Another Equation Solver

CALCULATION EXAMPLE
Cell Addressing in Excel
• A formula is an expression telling Excel to perform an operation.
• Many of the formulas we have been looking at have been limited to
arithmetic operations.

• An arithmetic formula begins with the equal sign ( = ) followed by an


arithmetic expression. The expression may contain numeric values, cell
addresses and arithmetic operators.

• These expressions are evaluated following the order of precedence shown


below:

 Exponentiation (^)
 Negation ( - )
 Multiplication and Division ( *, / )
 Addition and Subtraction ( + , - )

• The only way to override this order is to use BRACKETS ().


Cell Addressing in Excel
RELATIVE ADDRESSING
• Create a Workbook and Save as “CLASS EXCEL EXERCISES”

Exercise 2: Entering and Copying a Formula

a) On Sheet 1 of the workbook, in A4 enter the value 1. Select A4, “grab” the fill
handle and drag it down to A13 to fill the series (1 to 10) in these cells.

b.) In cell B4, enter the formula “=(12/3)*(A4-10)”.


Do not overlook the equal sign. The spaces around the subtraction operator are
optional but they do make the formula more readable.
The cell displays the value -36.

c.) We need to copy this formula to B5:B13. You can select the range and use
the shortcut key Ctrl+C and Ctrl+V. Or you can use the Auto Fill Option. Select
B4, “grab” the fill handle and drag it down to B13 to copy the content of B4 to
these cells below it.

d.) Title the Worksheet as “Relative Addressing” and Save the workbook.
Cell Addressing in Excel

An Example of Relative Addressing in Excel…

Exercise 2: Entering and Copying a Formula


Cell Addressing in Excel
• The concept of Relative Addressing is where Excel follows this reasoning:
“The formula is , originally, in B4, and part of this formula refers to the cell A4
which is one cell to the left but in the same row. When it copies the formula to B5,
the A4 becomes A5 – one cell to the left in the same row.”
Cell Addressing in Excel
PARTIAL AND ABSOLUTE ADDRESSING
• In Exercise 2, we saw that Excel normally treats cell references as relative
addresses when a formula is copied. There are times when this is not what we
need.
• Let “=A1” be the formula to be copied; we may modify this in three ways by
adding one or more $ symbols:

Modification Result When Formula is Copied Name


=A$1 The row remains constant Partial Addressing
=$A1 The column remains constant Partial Addressing
=$A$1 Both the row and the column remain Absolute Addressing
constant

• Remember, that when a formula is copied to the same row, the row reference is
unchanged without the need for the $ symbol. Similarly, when a formula is copied to the
same column, the column reference is unchanged with the $ symbol.
Cell Addressing in Excel
PARTIAL AND ABSOLUTE ADDRESSING

• A simple example is a worksheet showing a multiplication table as shown below:

Complete Exercise 3 (the next slide) to create the multiplication table shown above 
Cell Addressing in Excel
Exercise 3: Absolute Address

a.) Move to Sheet 2 of the workbook “CLASS EXCEL EXERCISES”. Start by


entering the values 2 and 3 in B1 and C1. Use the Series Fill method to complete
the row. Enter the data in column A in a similair manner.

b.) In B2 we need a formula to computer A2xB1. If we use “=A2*B1” we will not be


able to copy it. What we need is “=$A2*B$1”.

• The $ before the A in the first term ensures that, when the formula is copied across
the worksheet, the reference will always be to that column.
• Similarly, the $ in the second term keeps the reference to row 1 constant when the
formula is copied down the worksheet.

c.) Copy B2 to B2:J10

d.) Examine the values and the formulas in a few cells to make sure you
understand the process.

e.) Rename the Worksheet as “Absolute Addressing” and Save the workbook
Application of Cell Addressing - Matrices
• Cells may be addressed as:

 Relative Addresses
 Partial Addresses
 Or Absolute Addresses

• To further understand the concepts of cell addressing, we will produce a matrix


multiplication frame work.

• Matrix methods given in Excel are useful in many ways and for engineers
matrices are most useful in solving problems in structural analysis and
hydraulics.
Application of Cell Addressing - Matrices
REVISION OF MATRICES

Matrix Algebra provides a powerful method for the manipulation of sets of numbers.
Many mathematical operations, such as addition, subtraction, multiplication and
division have their counterparts in matrix algebra.
For our discussion we will be limited to the manipulation of square matrices.
For the purposes of illustration, below are two 3x3 matrices.
Application of Cell Addressing - Matrices
REVISION OF MATRICES

Addition or Subtraction of Matrices

• Addition of a Constant

• Addition of Two Matrices (Both Must Have the Same Dimensions)


Application of Cell Addressing - Matrices
REVISION OF MATRICES

Multiplication or Division of Matrices

• Multiplication or Division by a Constant

• Multiplication of Two Matrices can be either:


Scalar
OR
Matrix Multiplication
Application of Cell Addressing - Matrices

SCALAR MULTIPLICATION - of two matrices consists of multiplying the elements of a


matrix by a constant or by multiplying corresponding elements of two matrices.

• For Scalar Multiplication, both matrices must have the same dimensions m x n.

• Also scalar multiplication is commutative, that is, A x B = B x A


Application of Cell Addressing - Matrices

MATRIX MULTIPLICATION - of two matrices is somewhat more complicated. The


individual matrix elements of the matrix product of C of two matrices A and B are given
by

Where i is the row number and j is the column number.


For Example:

• Matrix Multiplication is ,generally, NOT COMMUTATIVE that is, A x B K B x A


Excel Functions for Matrices
• Performing matrix mathematics with Excel is very simple.
• To begin, let’s first create the following two matrices – Matrix A and Matrix B by
using the Define Name feature. (we will assign a range name to a range of cells)
• Go to the Next Worksheet in your CLASS EXERCISES excel work book and name
this workbook “Using Matrices”

Steps to Name Your Matrix:

1.) Enter the matrix values into the cells.


2.) Select the cell range containing the values.
3.) Go to the Formulas Tab and under the Define Name Group select “Define
Name” and name your matrix and click OK.

Now you can use your matrix to perform various operations in Excel.
• Create the Following Two Matrices within Excel and name these Matrices as:
• MatrixA
• MatrixB

• Now, we that we have named these matrices we will be able to use them and do some
mathematical operations.
Excel Functions for Matrices

Addition or Subtraction of Matrices in Excel:

Activity 1:
ADD a constant 3 to Matrix A.
1. Select a range of cells the same size of the matrix.
2. Enter the formula “=MatrixA + 3” and Press CTRL+ Shift + ENTER

Activity 2:
SUBTRACT 2 from Matrix B
1. Select a range of cells the same size of the matrix.
2. Enter the formula “=MatrixB – 2” and Press CTRL + Shift + ENTER
Excel Functions for Matrices
Multiplication or Division of Matrices in Excel:

Activity 3 :
MULTIPLY a constant 1.2 to Matrix A.
1. Select a range of cells the same size of the matrix.
2. Enter the formula “=MatrixA * 1.2” and Press CTRL+ Shift + ENTER

Activity 4:
DIVIDE 2 from Matrix B
1. Select a range of cells the same size of the matrix.
2. Enter the formula “=MatrixB / 2” and Press CTRL + Shift + ENTER

Scalar Multiplication of Matrices in Excel:

Activity 5: SCALAR MULTIPLICATION


Multiply Matrix A and Matrix B.
1. Select a range of cells the same size of the matrix.
2. Enter the formula “=MatrixA * MatrixB “ and Press CTRL + Shift + ENTER
Excel Functions for Matrices

• Matrix Multiplication can be accomplished easily by the use of Excel’s worksheet


function MMULT (matix1, matrix2).

• For the matrices A and B defined previously , entering the fomula “=


MMULT(MatrixA, MatrixB)” yields the result shown below.

Activity 6:
Multiply Matrix A and Matrix B.
1. Select a range of cells the same size of the matrix.
2. Enter the formula “=MatrixA * MatrixB “ and
Press CTRL + Shift + ENTER
Excel Functions for Matrices

* Note that multiplying MATRIX B * MATRIX A by matrix multiplication will result in a


completely different solution.
Excel Functions for Matrices

• This is because matrix multiplication is NOT communicative!

MMULT (MATRIXA , MATRIXB) K MMULT (MATRIXB , MATRIXA)

• Also matrix multiplication of two matrices is possible only if the matrices are
conformable – the number of columns of A is equal to the number of rows of
B.
• The easiest way to remember this is by checking the sizes of your matrices
before performing matrix multiplication. For example, the following table
shows some matrices’ sizes which are part of the MMULT function/formula
and the possible resulting matrices.

FORMULA RESULT The Two


Inner Indices
MMULT (4 x 3 matrix , 3 x 1 matrix) 3x1 matrix
must be the
MMULT( 4 x 3 matrix, 1 x 4 matrix) #value! Same
MMULT (1 x 4 matrix, 4 x 3 matrix) 1x4 matrix
Excel Functions for Matrices
There are many other matrix operations that you can explore in Excel, but the other process
relevant to our course is the MATRIX INVERSION.

• The Process of inverting a matrix “manually” can be tedious, but a nifty function in Excel
can make this an easy task.
• To find the inverse of a matrix we use Excel’s worksheet function MINVERSE (matrix).

Steps to Find the Inverse of a Matrix in Excel:


1. Select a range of cells the same size of the matrix.
2. Enter the formula “=MINVERSE(MATRIXB) “ and Press CTRL + Shift + ENTER

The inverse of the matrix B is shown below.


Solving Simultaneous Equations using Matrices

• Simultaneous equations can be represented in matrix notation by


𝑨𝑿 = 𝑪
where A is the matrix of coefficients, B is the matrix of unknowns (X) and C is the matrix
of constants.
• From our knowledge of matrix mathematics, we know that to find the unknowns (X)
we have to multiply the constants (C) by the inverse of the matrix of coefficients (A-1).
𝑿 = 𝑨−𝟏 𝑪

• In other words, the solution matrix is obtained by multiplying


the matrix of constants by the inverse matrix of the coffecients.
To return the solution values, we would combine the two
worksheet functions of MMULT and MINVERSE.
Solving Simultaneous Equations using Matrices
Given the following problem:

• Identify your three matrices:


 A=?
 X=? AX = C
 C=?
• Check that matrix multiplication is possible
• Enter values into Excel Worksheet
• Name the Matrices
• Perform the Calculation Using a Combination of the two worksheet
functions:
 Select a suitable cell range for the answer
 Use the formula “= MMULT(MINVERSE())” to solve for the unknown X = A-1C
matrix X.
 Press CTRL + Shift + ENTER
Solving Simultaneous Equations using Matrices
Tutorial #3
IN SUMMARY

QUESTIONS
TUTORIAL:
 Complete Tutorial#3 – Solving Simultaneous Equations

ASSIGNMENT1:
 Pick up on Wednesday 27th/02/18 8am
 Due on Friday 09th/03/18 8am

TEST
Test #1 Will Be in Wk#7 and will be Based on all
Topics Covered Up To Week#5.

You might also like