Contact

MMULT in Google Sheets: Multiply Matrices and Verify Output Shape

Array Intermediate Google Sheets

Calculate Sheets matrix products with a rectangular example, full dot products, reverse-order contrasts and compatible identity matrices.

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

Quick answer: MMULT performs row-by-column matrix multiplication. A two-by-three matrix times a three-by-two matrix returns a two-by-two result. The first matrix column count must equal the second matrix row count, as Google explicitly documents.

Availability and version history

  • Introduced: first service launch date is not established by the official history reviewed; no numbered desktop introduction is assigned.
  • Availability: documented in the rolling Google Sheets service. Examples target ordinary web-spreadsheet cells; mobile clients and imported file modes are not separately certified.
  • Checked: October 14, 2026; official MMULT reference. Documentation and independently calculated examples, without native Sheets execution.

Syntax and dimension rule

=MMULT(matrix1, matrix2)

Both arguments are arrays or ranges. If their shapes are m-by-n and n-by-p, the result is m-by-p. Matching the inner dimension is necessary; the matrices do not need identical overall shapes.

Use numeric entries, keep headers outside input ranges and leave a clear result area. These examples use English function names and comma separators. The help does not establish every blank, text or shape-error code, so no native code is guessed here.

Example 1: enter two compatible rectangles

Enter the first matrix in A2:C3:

A B C
1 2 0
3 -1 4

Enter the second matrix in E2:F4:

E F
2 1
0 3
1 -2

In a clear two-by-two area beginning H2:

=MMULT(A2:C3,E2:F4)

Independently expected H2:I3 values are rows 2,7 and 10,−8. The input dimensions are 2×3 and 3×2, so their shared inner size is three and the output shape is 2×2.

Example 2: verify all four dot products

The expected result entries are:

  • Upper left: 1×2+2×0+0×1=2
  • Upper right: 1×1+2×3+0×(−2)=7
  • Lower left: 3×2+(−1)×0+4×1=10
  • Lower right: 3×1+(−1)×3+4×(−2)=−8

Each output combines one entire row of the first matrix with one entire column of the second. Ordinary elementwise multiplication would not perform those sums and does not describe the same operation.

The zeros are actual numeric cells. Empty-looking source data and imported text require separate type checks; this finite matrix control does not establish their native treatment.

Advanced example: reverse the order deliberately

=MMULT(E2:F4,A2:C3)

This order is also dimensionally valid, now 3×2 times 2×3. Its expected output is three-by-three:

First column Second column Third column
5 3 4
9 -3 12
-5 4 -8

The table headers are explanatory and are not part of the returned array. Both the shape and values differ from the original two-by-two product. Matrix multiplication is generally not commutative, even when both orders are valid.

Advanced check: multiply by the correctly sized identity

For the two-by-three A2:C3 matrix:

=MMULT(MUNIT(2),A2:C3)
=MMULT(A2:C3,MUNIT(3))

Both independently expected outputs reproduce rows 1,2,0 and 3,−1,4. The left identity matches the source row count, while the right identity matches its column count.

Choosing MUNIT(3) on the left would create incompatible inner dimensions for this source. The operation’s shape rule determines the identity size, rather than a preference for square matrices of one fixed size. See MUNIT.

Advanced example: apply a two-variable linear transformation

On a separate sheet, enter rows 3,1 and 2,1 in A2:B3, and the column vector 2,1 in D2:D3:

=MMULT(A2:B3,D2:D3)

Expected column output: 7,5. The first row computes 3×2+1×1; the second computes 2×2+1×1. This is the forward transformation checked by the MINVERSE example.

Changing D2:D3 to 1,0 returns 3,2, the first matrix column. Changing it to 0,1 returns 1,1, the second column. These basis-vector controls make the row/column orientation easy to inspect.

Advanced check: distinguish one scalar from an array result

A one-row matrix 1,2,0 multiplied by the matching one-column matrix 2,0,1 gives a one-by-one result 2. A larger product may contain that same scalar as only one entry.

Do not reduce a returned matrix to its top-left cell simply because the first visible value looks plausible. Compare the full expected dimensions and every relevant entry. ROWS and COLUMNS can help check the selected input shapes.

Troubleshooting and verification limits

Google’s array-formula guidance discusses result expansion; preserve enough clear space for the intended output. The specific MMULT page establishes the dimension rule, but does not certify maximum sizes, all native obstruction/type errors or precision under extreme magnitudes.

Every result above is an independently computed product of the displayed numeric matrices. No Sheets engine, imported-workbook mode or mobile-client runtime was used to capture these answers.

References and verification

Inputs are fictional. Approximate answers are independent mathematical expectations rounded to nine places, not captured native results. Complete type/error matrices, extreme-magnitude accuracy and cross-client behavior remain untested.