MMULT function

MMULT multiplies two matrices and returns the resulting matrix, performing linear algebra calculations for transformation and scaling operations.

=MMULT(array1, array2)

Generate a MMULT formula

Describe what you need. The generator will reach for MMULT where MMULT is the right tool, and tell you when it is not.

How to get a better answer
  • Name your columns by letter and by header: "column F (Net Value)" beats "the amount column".
  • State every condition, including the negatives — "not cancelled" changes the formula's shape.
  • Say where the data starts if it is not row 1, and whether it will grow.
  • Check the settings above match your spreadsheet: the wrong argument separator is a syntax error on your machine.

Arguments

How MMULT reads its arguments
array1requiredarray2requiredMMULT
ArgumentRequiredDescription
array1RequiredRequired; the first matrix as a range or array constant. Must be numeric; if columns don't match array2's rows, returns #VALUE!.
array2RequiredRequired; the second matrix as a range or array constant. Must be numeric; row count must equal array1's column count.

Returns

A matrix (array) with dimensions equal to the row count of array1 and column count of array2.

Availability

Excel: All · Google Sheets: Supported

Worked examples

1. Calculate total ingredients to fulfill dish orders

IngredientPizzaPastaSaladOrders
Flour21050
Tomato11130
Cheese0.50.30.220
Oil0.10.10.05
Salt0.020.020.01
=MMULT({2,1,0;1,1,1;0.5,0.3,0.2;0.1,0.1,0.05;0.02,0.02,0.01},{50;30;20})

Result: [[130], [75], [38], [9], [1.8]]

The recipe matrix (5 ingredients × 3 dishes) multiplies by order quantities (3 dishes × 1) to produce total amounts needed. Each ingredient's total is the sum of (amount per dish × orders): Flour = 2×50 + 1×30 + 0×20 = 130 kg.

2. Calculate total inventory value

IngredientQty on HandUnit Cost ($)
Flour502
Tomato301.5
Cheese254
Oil401.2
Salt100.5
=MMULT({50,30,25,40,10},{2;1.5;4;1.2;0.5})

Result: 298

Multiplying the quantity row vector (1 × 5) by the unit cost column vector (5 × 1) yields a single scalar (1 × 1). Total inventory value = 50×2 + 30×1.5 + 25×4 + 40×1.2 + 10×0.5 = $298.

3. Allocate supply costs by vendor

SupplierFlourTomatoCheeseOilSalt
Baker Co400000
Fresh Produce10300100
Dairy Inc0025010
=MMULT({40,0,0,0,0;10,30,0,10,0;0,0,25,0,10},{2;1.5;4;1.2;0.5})

Result: [[80], [77], [105]]

The supplier matrix (3 suppliers × 5 ingredients) multiplied by unit costs (5 × 1) gives the cost owed to each vendor. Baker Co: $80 (flour only), Fresh Produce: $77 (flour + tomato + oil), Dairy Inc: $105 (cheese + salt).

Common errors

Which MMULT error are you seeing?
MMULT returned an error#VALUE!
Check both matrix dimensions. If array2 has the wrong shape, wrap it with TRANSPOSE() to swap rows and columns.
#VALUE!
Verify all cells are numeric. Use IFERROR() to convert text numbers or VALUE() to coerce text to numbers. Remove any error values from the matrices.
#SPILL!
Clear empty cells in the worksheet to accommodate the result, or move your formula to a location with more available space.
ErrorWhy it happensHow to fix it
#VALUE!array1's column count doesn't match array2's row count. For example, a 5×3 matrix multiplied by a 4×1 matrix fails because 3 ≠ 4.Check both matrix dimensions. If array2 has the wrong shape, wrap it with TRANSPOSE() to swap rows and columns.
#VALUE!One or both arrays contain non-numeric values such as text, dates, or error values. MMULT requires pure numbers in all cells.Verify all cells are numeric. Use IFERROR() to convert text numbers or VALUE() to coerce text to numbers. Remove any error values from the matrices.
#SPILL!The result matrix is too large to fit in the available worksheet space. For example, a 10×10 result needs 100 empty cells below the formula.Clear empty cells in the worksheet to accommodate the result, or move your formula to a location with more available space.

Tips and when to use something else

  • MMULT requires exact dimension matching: array1 columns must equal array2 rows. Use TRANSPOSE() to swap dimensions if needed.
  • For simple dot products (like total cost), consider SUMPRODUCT() instead—it's more readable and doesn't require careful matrix layout.
  • Always ensure data is numeric. Text that looks like numbers (often from imports) will cause #VALUE!. Use TRIM() and VALUE() to clean.
  • MMULT is best for scaling and linear transformations. For conditional sums or lookups, try SUMIF(), INDEX()-MATCH(), or XLOOKUP() instead.

Frequently asked questions

Can MMULT multiply more than two matrices at once?
No, MMULT takes exactly two arrays. To multiply three matrices (A × B × C), nest the formula: =MMULT(MMULT(A,B),C). This first multiplies A and B, then multiplies that result by C.
What's the difference between MMULT and SUMPRODUCT?
SUMPRODUCT multiplies corresponding elements and sums the result, giving a single value. MMULT performs full matrix multiplication and can return an entire matrix of results. Use MMULT for linear transformations and SUMPRODUCT for simple weighted totals.
Do I need to enter MMULT as an array formula?
In Excel 2019 and earlier, press Ctrl+Shift+Enter to enter MMULT as an array formula. In Excel 365 and Google Sheets, simply press Enter—the result automatically spills across cells, so no special entry is needed.
Why does MMULT show a single number instead of an array for some results?
When the result is a 1×1 matrix (one row, one column), spreadsheets display it as a scalar value. It's technically still a matrix, but a single-cell matrix is shown as just the number itself.

Need a different formula?

The full generator is not scoped to one function — describe any spreadsheet problem and it will pick.

Open the formula generator

Reviewed 2026-09-17