
The Excel MMULT function returns the matrix product of two numeric arrays. The result is an array with the same number of rows as the first array and the same number of columns as the second array.
MMULT is different from ordinary cell-by-cell multiplication. Instead of multiplying positions directly, it combines rows from the first array with columns from the second array. That is why MMULT is used in matrix algebra, coordinate transforms, systems of equations, and weighted linear calculations.
MMULT is useful because matrix multiplication captures relationships that ordinary one-cell multiplication cannot. It becomes important when the workbook needs to combine arrays according to matrix rules instead of just multiplying matching positions one by one.
Use MMULT when the calculation depends on matrix multiplication rather than ordinary cell-by-cell multiplication.
The output has the same number of rows as array1 and the same number of columns as array2.
=MMULT(array1, array2)
Both arguments are required. The number of columns in array1 must match the number of rows in array2. Microsoft also notes that both arrays must contain only numbers.
| Array 1 Shape | Array 2 Shape | Allowed? | Result Shape |
|---|---|---|---|
| 2 x 2 | 2 x 2 | Yes | 2 x 2 |
| 2 x 3 | 3 x 1 | Yes | 2 x 1 |
| 3 x 2 | 3 x 3 | No | #VALUE! |
| 1 x 5 | 5 x 1 | Yes | 1 x 1 |
The key rule is simple: inner dimensions must match. If they do not, MMULT cannot be performed.
MMULT is often used when one set of values needs to be applied linearly to another. A common example is multiplying a matrix of coefficients by a vector of inputs. In practical terms, that can represent weighted totals, coordinate transforms, or the final step in solving a matrix equation.
It is also important to remember that matrix multiplication is order-sensitive. In general, MMULT(A,B) is not the same as MMULT(B,A). Even when both products are allowed, they may return different answers. That makes argument order part of the logic, not just a formatting detail.
In Microsoft 365, MMULT spills automatically into the needed output cells. In older Excel versions, you must select the full output range first and confirm the formula as an array formula with Ctrl+Shift+Enter. If cells in the spill area are blocked, the result may not display as expected.
This is the standard starting point for learning MMULT.
=MMULT(A1:B2,C1:D2)
The result is another 2x2 matrix. Each output cell is calculated from one row of the first matrix and one column of the second matrix. This example is useful because it shows the structure of matrix multiplication without too much size or notation.
In cell D4, multiply matrix A1:B2 by C1:D2.
This is one of the most practical matrix patterns in Excel.
=MMULT(A1:B2,G1:G2)
Here, a 2x2 matrix is multiplied by a 2x1 vector. The result is a 2x1 vector. This format appears often when a matrix of coefficients is applied to a column of inputs, costs, or measurements.
In cell D7, multiply the 2x2 matrix A1:B2 by the 2x1 vector G1:G2.
The identity matrix is the matrix equivalent of multiplying by 1.
=MMULT(A1:B2,MUNIT(2))
The result should match the original matrix A1:B2. This is a useful check because it confirms both the role of the identity matrix and the way MMULT preserves the input when the second matrix is MUNIT(2).
In cell D10, multiply matrix A1:B2 by MUNIT(2) and check that the matrix stays unchanged.
A larger example makes the output shape more obvious.
=MMULT(A1:C3,D1:F3)
This returns a 3x3 result because the first matrix has 3 rows and the second has 3 columns. It is a good way to confirm that the output size depends on the outer dimensions, not the inner ones.
In cell D13, multiply the 3x3 matrices A1:C3 and D1:F3.
Common errors are straightforward. MMULT returns #VALUE! if the inner dimensions do not match or if either array contains text or empty cells. That is why it is worth checking both the shape and the data type of the input ranges before using the function in a larger model.
array1 by columns of array2.MMULT is the matrix multiplication function, so it does a very different job from normal cell-by-cell multiplying. The main idea in this lesson was that the inner dimensions have to match, and the result size comes from the outer dimensions.
The examples helped show what that means in practice. You can multiply two matrices, multiply a matrix by a vector, or use the identity matrix to check that the result behaves the way you expect. Once that shape logic clicks, MMULT becomes much easier to follow.
MMULT returns the matrix product of two arrays.#VALUE! appears when dimensions do not match or the arrays are not fully numeric.Tell your friends about this post