Contact

Apple Numbers MMULT: Matrix Multiplication with Worked Examples

Math Intermediate Apple Numbers

Multiply compatible matrices in Numbers, inspect row-by-column calculations, price product batches and see why multiplication order changes the answer.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: MMULT multiplies rows from the first matrix by columns from the second. A 2×3 matrix multiplied by a 3×2 matrix produces a 2×2 result. The inner dimensions must match.

Availability and version history

  • Introduced: Original release and introduction date are not established by the checked references.
  • Availability: Currently documented in Apple’s Functions Help 15.4 documentation edition; no final supported-version endpoint is established.
  • Scope: Shared iWork reference. Function-specific historical availability across Mac, iPad, iPhone and iCloud is unverified.
  • Checked: October 14, 2026, against the official MMULT reference. Independent exact matrix calculations; no native Numbers test.

Syntax and dimension rule

=MMULT(matrix-1, matrix-2)

Both arguments are numeric arrays and both are required. Apple specifies that the first array’s column count must equal the second array’s row count. The outer dimensions determine the product’s shape. This differs from multiplying corresponding cells individually.

These examples use INDEX to read one row/column position from an array. Apple’s INDEX reference explicitly supports arrays returned by other functions. Each displayed result therefore has its own scalar formula; the instructions do not depend on a particular app build spilling an entire matrix into adjacent cells.

Reproduce Apple’s rectangular example

Create MatrixProduct, a Numbers table with twelve columns A:L and eight rows, including a header row. Enter the first matrix in A2:C3 and the second in A5:C7. The intervening row is outside both input ranges.

Cells A B C
A2:C2 1 3 5
A3:C3 2 4 6
A5:C5 1 2 7
A6:C6 3 4 8
A7:C7 5 6 9

The first array is 2×3 and the second 3×3. Read the 2×3 result into E2:G3 using these six scalar formulas:

Cell Formula Expected result
E2 =INDEX(MMULT($A$2:$C$3,$A$5:$C$7),1,1) 35
F2 =INDEX(MMULT($A$2:$C$3,$A$5:$C$7),1,2) 44
G2 =INDEX(MMULT($A$2:$C$3,$A$5:$C$7),1,3) 76
E3 =INDEX(MMULT($A$2:$C$3,$A$5:$C$7),2,1) 44
F3 =INDEX(MMULT($A$2:$C$3,$A$5:$C$7),2,2) 56
G3 =INDEX(MMULT($A$2:$C$3,$A$5:$C$7),2,3) 100

Enter each formula as shown; copying a formula does not increment the literal INDEX positions. The source example starts its first matrix at A1 and second at A4; this table shifts both down one row for headings without changing the values.

Read one output as a dot product

Enter these independent arithmetic formulas outside both arrays:

Cell Formula Expected result
I2 =A2*A5+B2*A6+C2*A7 35
I3 =A2*B5+B2*B6+C2*B7 44
I4 =A2*C5+B2*C6+C2*C7 76

I2 pairs the first row, 1,3,5, with the first column, 1,3,5. Its sum is 1+9+25. I3 uses the second column, 2,4,6, giving 2+12+30. The selected column changes while the first source row stays fixed.

Selecting A5:C6 instead would produce a 2×3 second input, whose two rows do not match the first input’s three columns. That selection violates the documented rule; this guide does not invent a specific displayed error code.

Advanced: price three product batches under two suppliers

Create BatchCosts, with nine columns and seven rows, including one header row. In A2:C4 enter material quantities per batch. Columns A,B,C represent fabric, fittings and packaging:

Row Fabric Fittings Packaging
2 2 1 0
3 1 0 3
4 0 2 1

In A5:B7 enter the unit-price matrix. Its rows must follow the same material order: fabric 4,5, fittings 10,8, packaging 3,6. Its columns represent Supplier A and Supplier B. Keep any explanatory text outside these numeric blocks.

Use F2:G4 for the 3×2 product. Enter =INDEX(MMULT($A$2:$C$4,$A$5:$B$7),1,1) in F2 and position 1,2 in G2. In F3:G3 use positions 2,1 and 2,2; in F4:G4 use 3,1 and 3,2.

Row Expected F: Supplier A Expected G: Supplier B
2 18 18
3 13 23
4 23 22

The first supplier’s second-batch cost is 1×4 + 0×10 + 3×3 = 13. Equal dimensions are necessary but not sufficient for a meaningful model: rearranging price rows without rearranging quantity columns pairs different materials and produces misleading totals.

Multiplication order can matter even for square matrices

Create OrderCheck, with seven columns and four rows. Put rows 1,2 and 0,1 in A2:B3, and rows 2,0 and 0,3 in D2:E3.

In G2 enter =INDEX(MMULT(A2:B3,D2:E3),1,2); expect 6. In G3 reverse the two ranges; expect 4. Both products are defined, but they are different. Their complete matrices are [2,6;0,3] and [2,4;0,3], where the semicolon here separates rows in prose rather than specifying a Numbers array-entry syntax.

Use numeric data ranges without labels or totals, and keep result formulas outside the inputs. The short reference does not fully define blank, text, error, dimension-limit or floating-point behavior. A product can also be numerically valid but conceptually wrong because its categories or units are misaligned.

MUNIT supplies a correctly sized identity for a no-change product. MINVERSE can produce an inverse when one exists, and MDETERM returns a scalar determinant for a square matrix.