MMULT function
Returns the matrix product of two arrays as a spilled array (rows of the first times columns of the second).
Available in All versions of Excel; spills in Microsoft 365 and Excel 2021+, older versions need Ctrl+Shift+Enter
In every Excel versionWorks in Google Sheets
Syntax
MMULT(array1, array2)| Argument | What it means | |
|---|---|---|
array1 | Required | The first matrix. Its number of columns must equal the number of rows of array2. |
array2 | Required | The second matrix. |
Returns: An array with as many rows as array1 and as many columns as array2.
How MMULT works
MMULT multiplies two matrices. Each cell of the result is the SUMPRODUCT of one row of the first array with one column of the second. In business terms: multiply a table of quantities (stores × products) by a list of prices (products × 1) and you get revenue per store in one formula; multiply a recipe table by ingredient costs to get the cost of every product.
The inner sizes must match: a 2 × 3 table can be multiplied by a 3 × 1 column, giving 2 × 1. Order matters, because A×B is not the same as B×A. Empty cells or text inside the arrays return #VALUE!. MMULT is also a building block for advanced formulas, for example MMULT(range, {1;1;1}) to get row totals as an array, and with MINVERSE to solve systems of equations.
Examples
1Revenue per store from quantities and prices
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | Store | Coffee | Tea | Cake | Item | Price | ||
| 2 | Centre | 10 | 5 | 2 | Coffee | 3 | 76.5 | |
| 3 | Harbour | 4 | 8 | 6 | Tea | 4.5 | 120 | |
| 4 | Cake | 12 |
Centre: 10×3 + 5×4.5 + 2×12 = 76.5. Harbour: 4×3 + 8×4.5 + 6×12 = 120. The 2 × 3 quantity table times the 3 × 1 price column gives a 2 × 1 result.
2Row totals as an array
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Employee | Mon | Tue | Wed | ||
| 2 | Ana | 8 | 7.5 | 8 | 23.5 | |
| 3 | Ben | 6 | 8 | 4 | 18 |
Multiplying by a column of ones adds each row: Ana worked 23.5 hours, Ben 18. In Microsoft 365, BYROW does the same more readably.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#VALUE! | Columns of array1 do not equal rows of array2, or a cell is empty or text. | Check sizes (e.g. 2×3 with 3×1) and fill blanks with 0. |
#SPILL! | The output area is not empty. | Clear the cells. |
Tips
- If sizes are wrong, try TRANSPOSE on one of the arrays.
- For element-by-element multiplication use
*, not MMULT.
Google Sheets
MMULT also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
MMULT in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Czech | SOUČIN.MATIC |
| Danish | MPRODUKT |
| Dutch | PRODUCTMAT |
| Finnish | MKERRO |
| French | PRODUITMAT |
| Hungarian | MSZORZAT |
| Italian | MATR.PRODOTTO |
| Polish | MACIERZ.ILOCZYN |
| Portuguese (Brazil) | MATRIZ.MULT |
| Portuguese (Portugal) | MATRIZ.MULT |
| Russian | МУМНОЖ |
| Turkish | DÇARP |