O'Reilly logo

Excel Scientific and Engineering Cookbook by David M Bourg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

7.10. Manipulating Matrices

Problem

You need to manipulate matrices in your calculations and would like to know what support Excel offers for dealing with matrices.

Solution

Excel has several built-in matrix functions for computing matrix inverses and determinants and for multiplying or transposing matrices.

Discussion

Table 7-7 summarizes Excel's built-in matrix functions.

Table 7-7. Excel's built-in matrix functions

Function

Syntax

Description

MDETERM

=MDETERM( cell range )

Returns the determinant of the matrix argument, which must be a square matrix.

MINVERSE

=MINVERSE( cell range )

Returns the inverse of the matrix argument, which must be a square matrix.

MMULT

=MMULT( cell range 1 , cell range 2 )

Returns the matrix product of the two matrix arguments. The resulting matrix has the same number of rows as the first argument and the same number of columns as the second.

TRANSPOSE

=TRANSPOSE( cell range )

Returns the transpose of the matrix argument.

MDETERM returns a scalar, which means you enter the function as a normal function, by pressing Enter. The other three functions are array functions, which means you first have to select an appropriate number of cells, then type the function and press Ctrl-Shift-Enter to enter the function.

Figure 7-3 shows how these functions can be used in a spreadsheet.

Matrix functions

Figure 7-3. Matrix functions

To enter a matrix in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required