34
Using Array Functions and Formulas
34.1 Overview
An Excel array function or formula performs an operation on a rectan-
gular block of cells. In the simplest cases, built-in Excel array functions
such as Transpose or MMult take an array and transpose it or take two
matrices and multiply them. Once you get the hang of array functions,
you can design your own array formulas. In this chapter, for example, we
show how to use array formulas to fi nd the minimum or maximum of
the off-diagonal elements of a matrix or to pick out the diagonal of a
matrix—all useful tricks to know when doing portfolio calculations such
as those discussed in Chapters 8–15.
The one critical thing to remember about array functions or formulas
in that they are entered into a spreadsheet by pushing the [Ctrl] + [Shift]
+ [Enter] keys simultaneously; this procedure contrasts with the usual
one whereby we enter a function or formula only by pushing [Enter].
34.2 Some Built-in Excel Array Functions
In this section we discuss some built-in Excel array functions: Transpose,
MMult, MInverse, and Frequency. Other functions are discussed else-
where in this book; for example, the function Linest is discussed in
Chapter 33.
34.2.1 Transpose
Suppose we’re trying to calculate the transpose of a 3 × 2 matrix (3 rows,
2 columns) that is in cells A2:B4 of the spreadsheet.
2
3
4
AB
15
26
37
Excel has a function called Transpose( ), but, like all array functions,
its use requires care:
•
First, block off the cells D3:F4 into which you intend to put the trans-
posed matrix.