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

Matrix Calculation in Excel

The document discusses matrix commands that can be performed in Excel, including addition, subtraction, scalar multiplication, matrix transposition, matrix multiplication, matrix inverse, and matrix determinant. It provides instructions for naming cells and matrices and entering matrices in Excel. It then explains how to use the built-in functions to perform each matrix operation and gives examples.

Uploaded by

Lv Linh
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
264 views

Matrix Calculation in Excel

The document discusses matrix commands that can be performed in Excel, including addition, subtraction, scalar multiplication, matrix transposition, matrix multiplication, matrix inverse, and matrix determinant. It provides instructions for naming cells and matrices and entering matrices in Excel. It then explains how to use the built-in functions to perform each matrix operation and gives examples.

Uploaded by

Lv Linh
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 12

Matrix Commands

in Excel
Anthony Murphy
Nuffield College
[email protected]

[email protected] - (+84)0869231510 - https://www.facebook.com/hedgeacademyvn/ - https://hedgeacademy.com.vn/


Matrix Commands in Excel
Excel can perform some useful, albeit basic, matrix
operations:
• Addition & subtraction;
• Scalar multiplication & division;
• Transpose (TRANSPOSE);
• Matrix multiplication (MMULT);
• Matrix inverse (MINVERSE);
• Determinant of matrix (MDETERM);
As well as combinations of these operations.

[email protected] - (+84)0869231510 - 2
https://www.facebook.com/hedgeacademyvn/ - https://hedgeacademy.com.vn/
Matrix Commands in Excel (Cont’d)

• In Excel the matrix commands (and some


other commands) are called ARRAY
commands.
• Can perform more complicated operations
using free add-ins for Excel e.g. MATRIX.
• Alternatively, can use matrix package like
MATLAB (which also does symbolic maths
& matrix algebra).
[email protected] - (+84)0869231510 - 3
https://www.facebook.com/hedgeacademyvn/ - https://hedgeacademy.com.vn/
Excel (Cont’d)
• The matrix commands in Excel are
sufficient for this course.
• If you are really keen, you can play around
with Visual Basic for Applications (VBA),
the Excel programming language.
• For example, see Benninga, S. (2000),
Financial Modelling, MIT Press.

[email protected] - (+84)0869231510 - 4
https://www.facebook.com/hedgeacademyvn/ - https://hedgeacademy.com.vn/
Named Cells
• Most Excel formulae require you to name one or
more cell ranges e.g. b2.c4.
• You can type these in directly or select them
using the mouse.
• However, it is often better to use a named range.
• To assign a name to a range of cells, highlight it
using the mouse and choose Insert ►Name ►
Define and enter a name.
• Choose a useful name.
• Remember Excel does not distinguish between
the names PRICE, Price and price.
[email protected] - (+84)0869231510 - 5
https://www.facebook.com/hedgeacademyvn/ - https://hedgeacademy.com.vn/
Entering a Matrix
• Choose a location for the matrix (or vector)
and enter the elements of the matrix.
• Highlight the cells of the matrix and
choose INSERT ► NAME ► DEFINE.
• Enter a name for the matrix.
• You can now use the name of the matrix in
formulae.

[email protected] - (+84)0869231510 - 6
https://www.facebook.com/hedgeacademyvn/ - https://hedgeacademy.com.vn/
Addition, Subtraction and Scalar
Multiplication Etc.

To add two named 3 x 2 matrices A and B:


• Highlight a blank 3 x 2 results area in the
spreadsheet. (If the results area is too small, you
will get the wrong answer.)
• Type =A+B in the formula bar and press the
CTRL, SHIFT and ENTER keys simultaneously.
• You must use the CTRL, SHIFT,ENTER keys if
you want to perform a matrix computation. (If
you don’t do this, you will get an error message
or the wrong answer.)
[email protected] - (+84)0869231510 - 7
https://www.facebook.com/hedgeacademyvn/ - https://hedgeacademy.com.vn/
Addition, Subtraction and Scalar
Multiplication Etc. (Cont’d)

• If you click on any cell in the result, the


formula {=A+B} will be displayed. In Excel,
the { } brackets indicate a matrix (array)
command.
• For an example of scalar multiplication,
see the Example Spreadsheet on the web
page.

[email protected] - (+84)0869231510 - 8
https://www.facebook.com/hedgeacademyvn/ - https://hedgeacademy.com.vn/
Matrix Transpose
• Suppose A is a 3 x 2 matrix.
• The transpose of A, A’, will be 2 x 3.
• Select a 2 x 3 results area, type
=TRANSPOSE(A) in the formula bar and
press CTRL, SHIFT, ENTER.
• Exercise: Choose A and B so that AB
exists. Check that (AB)' = B 'A‘ using
MMULT (matrix multiplication).
• What do you think (ABC)' is equal to?
[email protected] - (+84)0869231510 - 9
https://www.facebook.com/hedgeacademyvn/ - https://hedgeacademy.com.vn/
Matrix Multiplication
• Suppose A and B are named 3 x 2 and 2 x 3
matrices.
• Then AB is 3 x 3 and BA is 2 x 2. This illustrates
the fact that, in general, AB is not equal to BA,
even if the matrices are conformable.
• Select a blank 3 x 3 area for the result AB.
• Type =MMULT(A,B) in the formula bar and
press CTRL, SHIFT, ENTER to generate AB.

[email protected] - (+84)0869231510 - 10
https://www.facebook.com/hedgeacademyvn/ - https://hedgeacademy.com.vn/
Matrix Inverse
• Suppose B is a square 2 x2 matrix.
• Select a 2 x 2 area for the inverse of B.
• Type =MINVERSE(B) in the formula bar and
press CRTL, SHIFT, ENTER.
• If B is singular (non-invertible), you will get an
error message.
• Suppose A and B have the same dimension and
are both invertible. Show that (AB)-1 = B-1A-1.
• What do you think (ABC)-1 is equal to?
[email protected] - (+84)0869231510 - 11
https://www.facebook.com/hedgeacademyvn/ - https://hedgeacademy.com.vn/
Matrix Determinant
• Suppose A is a square matrix.
• The determinant of A, det(A) or IAI, is a scalar.
• Select a single cell, type = MDETERM(A) in the
formula area and press CTRL, SHIFT, ENTER
(or just ENTER).
• If A is singular, then det(A) = 0.
• Exercise: Check that det(AB) = det(BA) =
det(A).det(B), where A and B are square
matrices.
[email protected] - (+84)0869231510 - 12
https://www.facebook.com/hedgeacademyvn/ - https://hedgeacademy.com.vn/

You might also like