MMULT Function

Excel Functions › Math & Trig

All versions Math & Trig

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.


Quick answer:
=MMULT({1,2;3,4},{5,6;7,8}) 2×2 product spills as {19,22;43,50}

Syntax

=MMULT(array1, array2)
ArgumentDescription
array1RequiredThe first (left) matrix. Its number of columns must match array2's number of rows.
array2RequiredThe 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.

=MMULT({1,2;3,4},{5,6;7,8}) // {19,22;43,50}

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

Live demo

Pick a MMULT example to see the formula and its result.

Result:

Practice workbook

📊
Download the free MMULT practice workbook
Every example on this page, ready to open in Excel — plus practice challenges with answers on a separate tab. No sign-up required.

Frequently asked questions

How is MMULT different from multiplying ranges directly?
Multiplying two ranges with * 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?
The number of columns in array1 must equal the number of rows in array2. An m×n matrix times an n×p matrix produces an m×p result.
Why does MMULT return #VALUE!?
The inner dimensions don't match, or one of the arrays contains a blank cell or text. Check the shapes and make sure every cell is numeric.
Does the order of the matrices matter?
Yes. Matrix multiplication is not commutative: 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

Related functions: MINVERSE · MDETERM · MUNIT · SUMPRODUCT · TRANSPOSE