Matrix Operations with Excel
You can perform the operations of matrix addition, matrix
subtraction, scalar
multiplication and matrix multiplication using Excel.
EXAMPLE: Let
Find:
a) A+ B
b) 3B
c) AC
Enter the matrices A, B, and C into your spreadsheet.
a) Recall that in order to add two matrices, they must be
the same size. In this
example both A and B are 3× 4 matrices, so we can add them . The result will be
another 3× 4 matrix. Highlight an empty group of cells that consist of three
rows
and four columns. Type =, then highlight the cells the make up the matrix A,
type
+, then highlight the cells that make up matrix B.
Note: The formula should look something like (assuming
that the entries of the
matrix A is start at B2, for the upper left corner, and finish at E4, for the
lower
right hand corner. Similarly the entries for the matrix B go from H2 to K4)
= B2:E4 + H2:K4
Press Ctrl -Shift-Enter to calculate the sum . The result is
To find the difference , use − instead of + .
b) To find the scalar product, highlight an empty group of
cells that has three rows
and four columns. Type =, then type 3 *, highlight the cells of the matrix B,
and
press Ctrl -Shift-Enter. This time the formula should look something like (again,
the cell addresses may differ if you put B in a different spot )
= 3*H2:K4
The result is
c) To find the matrix product you must use the MMULT
command. Remember that
the number of columns in the first matrix must equal the number of rows in the
second matrix. In this example, A is a 3× 4 matrix and C is a 4 × 3 matrix, so
the
number of columns in A is equal to the number of rows in C. The result will be a
3× 3 matrix.
Highlight an empty group of cells that has three rows and
three columns. Type
=MMULT(, then highlight the cells the make up the matrix A, followed by a
comma. Then highlight the cells that make up matrix C, followed by a right
parenthesis , ), then press Ctrl-Shift-Enter. The formula for this operation
should
look something like (for this example, the entries of matrix C go from B7 to
D10)
= MMULT(B2:E4, B7:D10)
The result is
EXERCISES
1. Let A, B, C, and D be given as follows:
Find:
a) A+ B
b) B − A
c) 4C
d) AC
e) BD
2. The sales (in thousands) for the ACMS Corporation in
2003 and 2004 are given
below.
2003 | Boston | Chicago | Seattle |
Wholesale | 780 | 840 | 620 |
Retail | 1,084 | 975 | 834 |
2004 | Boston | Chicago | Seattle |
Wholesale | 932 | 887 | 595 |
Retail | 1,243 | 889 | 956 |
a. Find the total sales by type and city for the two
years .
b. Find the change in sales by type and city from 2003 to 2004.
3. A clothing manufacturer has factories in Atlanta ,
Dallas, and Seattle. Sales (in
thousands) during the first quarter are summarized below .
Atlanta | Dallas | Phoenix | |
Coats | 94 | 47 | 28 |
Shirts | 104 | 123 | 98 |
Pants | 76 | 69 | 58 |
Ties | 31 | 43 | 37 |
During this period the selling price of a coat is $150, of
a shirt $45, of a pair of
pants $60, and of a tie $20. Find the total revenue received by each factory.
(Hint:
Use matrix multiplication.)
Prev | Next |