The Excel MMULT function returns the matrix product of two arrays. The number of columns in the first matrix must equal the number of rows in the second, and the result spills across cells.
Syntax
| Argument | Description | |
|---|---|---|
array1 | Required | The first (left) matrix. Its number of columns must match array2's number of rows. |
array2 | Required | The second (right) matrix. The result has array1's rows and array2's columns. |
How to use it
Matrix multiplication is not element-by-element. Each output cell is the dot product of a row from array1 and a column from array2. The inner dimensions must match: an m×n times an n×p matrix gives an m×p result.
The top-left cell is 1×5 + 2×7 = 19; the top-right is 1×6 + 2×8 = 22; the bottom row is 43 and 50. In Excel 365 the result spills; in older Excel select an m×p range and press Ctrl+Shift+Enter.
Inner dimensions must match. If array1's columns don't equal array2's rows — or either array contains blanks or text — MMULT returns #VALUE!. Order matters too: A·B is generally not equal to B·A.
Try it: interactive demo
Pick a MMULT example to see the formula and its result.
Practice workbook
Frequently asked questions
How is MMULT different from multiplying ranges directly?
* multiplies them element by element. MMULT does true linear-algebra matrix multiplication: each result cell is the dot product of a row and a column.What dimensions do the two matrices need?
Why does MMULT return #VALUE!?
Does the order of the matrices matter?
MMULT(A,B) is generally different from MMULT(B,A), and one order may even be invalid if the dimensions don't line up.Master functions like this in one day
This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class