Wauvel

Excel like a finance pro.

← The library

Math function

MMULT

Returns the matrix product of two arrays; rows of the first must match columns of the second.

OccasionalDifficulty 1500 · AdvancedUsage rank #229 of 520
Practice · 3 questions →

When to use it

Matrix product. The number of columns in the first array must equal the number of rows in the second. Weighted scores, portfolio math, and transition models all reduce to it.

The shape of it

Syntax
=MMULT(array1, array2)
Example
=MMULT(A2:C4,E2:G4)

Worked examples

  • 2 by 2 times 2 by 2

    =MMULT({1,2;3,4},{5,6;7,8}) {19,22;43,50}

    Rows of the first times columns of the second.

  • Dot product

    =MMULT({1,2,3},{4;5;6}) 32

    A row times a column is a single number: 4 + 10 + 18.

  • Weighted score

    =MMULT(B2:D2,F2:F4) 81

    Weights 0.5, 0.3, 0.2 in a row times scores 80, 90, 70 in a column.

Worth knowing

  • The result spills. Columns in array1 must equal rows in array2.
  • A row of weights times a column of values is the same as SUMPRODUCT, but MMULT scales to many rows at once.
  • Portfolio variance: MMULT(MMULT(w,Cov),TRANSPOSE(w)).
  • In older Excel confirm with Ctrl+Shift+Enter over the right-sized output range.

Where it goes wrong

  • #VALUE! when the inner dimensions do not match or a cell is blank or text.
  • Results spill; anything in the way causes #SPILL!.

Related

Learn the moves here — or let Wauvel run them on your numbers.

Meet your AI CFO →

One CFO-grade Excel tip a week

A short, practical email for finance operators — functions, shortcuts, and the moves that save an afternoon. Free, unsubscribe anytime.