Exceljet

Quick, clean, and to the point

Excel MMULT Function

Excel MMULT function
Summary 

The Excel MMULT function returns the matrix product of two arrays. The result from MMULT is an array that contains the same number of rows as array1 and the same number of columns as array2

Purpose 
Perform matrix multiplication
Return value 
The matrix product of two arrays
Syntax 
=MMULT (array1, array2)
Arguments 
  • array1 - The first array to multiply.
  • array2 - The second array to multiply.
Version 
Usage notes 

The MMULT function returns the matrix product of two arrays, sometimes called the "dot product". The column count of array1 must equal the row count of array2. The result from MMULT is an array that contains the same number of rows as array1 and the same number of columns as array2.  For example, you can multiply a 2 x 3 array by a 3 x 2 array to return a 2 x 2 array result.

In Excel 365, which supports dynamic arrays, MMULT will return multiple results directly on the worksheet. In earlier versions, you will need to enter as a multi-cell array formula with control + shift + enter.

Example

In the example shown, the MMULT formula is evaluated like this:

=MMULT(B6:D7,F6:G8)
=MMULT({0,3,5;5,5,2},{3,4;3,-2;4,-2})
={29,-16;38,6}

The MMULT function will return a #VALUE! error if array1 columns do not equal array2 rows.

Notes

  • Arrays must contain numbers only.
  • Columns in array1 must equal the rows in array2.
  • Array1 and array2 can be provided as cell ranges, array constants, or references.
  • MMULT returns the #VALUE! error if any cells in array1 and array2 are not numbers, or if array1 columns do not equal array2 rows.

Download 100+ Important Excel Functions

Get over 100 Excel Functions you should know in one handy PDF.