Math & trig function

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)
ArgumentWhat it means
array1RequiredThe first matrix. Its number of columns must equal the number of rows of array2.
array2RequiredThe 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

H2fx=MMULT(B2:D3, F2:F4)
ABCDEFGH
1StoreCoffeeTeaCakeItemPrice
2Centre1052Coffee376.5
3Harbour486Tea4.5120
4Cake12

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

F2fx=MMULT(B2:D3, {1;1;1})
ABCDEF
1EmployeeMonTueWed
2Ana87.5823.5
3Ben68418

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.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 15 KB

Common errors and how to fix them

ErrorWhy it happensFix
#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.

LanguageFunction name
CzechSOUČIN.MATIC
DanishMPRODUKT
DutchPRODUCTMAT
FinnishMKERRO
FrenchPRODUITMAT
HungarianMSZORZAT
ItalianMATR.PRODOTTO
PolishMACIERZ.ILOCZYN
Portuguese (Brazil)MATRIZ.MULT
Portuguese (Portugal)MATRIZ.MULT
RussianМУМНОЖ
TurkishDÇARP