You need to combine two tables of numbers, and simple multiplication will not do the job. Perhaps you are applying weights to scores, running a forecast, or transforming coordinates. These tasks call for matrix multiplication, a specific rule from linear algebra. Doing it by hand means dozens of multiply-and-add steps, with plenty of room for slips. The MMULT function does the whole thing for you. It multiplies two matrices using the proper row-by-column rule and returns the full result.
This guide makes matrix multiplication clear and practical. First, it explains the one rule that governs whether two matrices can multiply. Then it shows the dynamic array and legacy methods. Six real examples and a troubleshooting section round it out.
How Matrix Multiplication Works
Matrix multiplication is not element-by-element. That point surprises many beginners. Instead, each cell in the result comes from a whole row and a whole column. You multiply the row and column pairwise, then add the products. This is called a dot product. The infographic below shows one result cell being built this way.
Look at the top-left result cell. It uses the first row of A and the first column of B. Specifically, you pair the values, multiply each pair, and sum them. Every result cell follows this same pattern with its own row and column.
The One Rule: Inner Dimensions Must Match
Two matrices can only multiply if their shapes fit. The rule is short. The columns of the first matrix must equal the rows of the second. In other words, the inner dimensions must match. When they do, the outer dimensions give the size of the result.
The Syntax
MMULT takes two arguments, one for each matrix. The order matters. Matrix multiplication is not reversible, so A times B differs from B times A.
Example 1: A Basic 2x3 times 3x2 Product
Start with the case from the infographic. A 2x3 matrix multiplies a 3x2 matrix. The inner dimensions match, so it works. The result is 2x2.
Example 2: The Dynamic Array Method
In Excel 365 and 2021, MMULT is simple to enter. You type it in one cell and press Enter. The result then spills to fit. As a result, you never pre-select an output area.
=MMULT(A1:C2, E1:F3) and press Enter.Example 3: The Legacy Ctrl+Shift+Enter Method
Older Excel versions need array entry. The steps are similar to TRANSPOSE. First you select the output area at the right size. Then you confirm with three keys. Getting the size right is the key detail.
Example 4: Weighted Scores with MMULT
Here is a very practical use. Suppose each candidate has scores across several criteria. Each criterion carries a weight. MMULT applies the weights and sums them in one step. This gives a single weighted total per candidate.
Example 5: Combine Two Transformations
In graphics and modelling, transformations chain together. Each transformation is a matrix. Multiplying them combines their effects into one matrix. Therefore, one MMULT can merge a rotation and a scale, for example. You then apply the single combined matrix instead of two separate ones.
Example 6: Solve a System with MMULT and MINVERSE
MMULT is essential for solving linear equations. The method uses the inverse of the coefficient matrix. First you invert the coefficients with MINVERSE. Then you multiply that inverse by the answers column using MMULT. The product is the solution vector.
Example 7: Forecast with a Transition Matrix
MMULT powers a neat forecasting method. Suppose customers move between plans each month. A transition matrix holds those movement rates. Multiplying the current mix by this matrix predicts next month. Repeat it, and you project several months ahead.
Troubleshooting MMULT
All three problems below are the most common. Each has a clear cause and a quick fix.
You get a #VALUE! error
This is the most frequent MMULT error. Usually the inner dimensions do not match. Remember the rule: the columns of the first matrix must equal the rows of the second. Write both shapes side by side and check the inner numbers. If they differ, the multiplication is invalid. The other cause is non-numeric data. Every cell in both matrices must hold a number. Look for text, labels, or blanks inside either range. Fix the shape or the data, and the error clears.
The result is cut off in older Excel
In legacy Excel, a truncated result means the output selection was too small. MMULT fills exactly the block you selected before entering the formula. If that block is smaller than the true result, part of the answer is lost. To fix it, delete the formula and check the result size. The outer dimensions of your two matrices give it. Then select a block of exactly that size and re-enter with Ctrl+Shift+Enter. Selecting too many cells instead shows #N/A in the extras.
MMULT gives a different answer than I expected
Matrix multiplication depends on order, so this often traces to a swapped argument. MMULT(A,B) is not the same as MMULT(B,A). Confirm which matrix should come first in your calculation. Another common mistake is confusing MMULT with element-wise multiplication. If you only want to multiply matching cells, that is a simple A1*B1 formula, not MMULT. Decide which operation you actually need. Once the order and the operation are correct, the result will match your intent.
Frequently Asked Questions
- What does the MMULT function do in Excel?+MMULT performs matrix multiplication on two matrices and returns the resulting matrix. It follows the linear algebra rule, not simple element-by-element multiplication. Each cell of the result comes from multiplying a full row of the first matrix by a full column of the second, then summing those products. You write it as =MMULT(array1, array2). In Excel 365 the result spills automatically; in older versions you select the output area and press Ctrl+Shift+Enter. The two matrices must have matching inner dimensions, meaning the first matrix column count equals the second matrix row count.
- Why does MMULT return a #VALUE! error?+The most common cause is mismatched dimensions. For MMULT to work, the number of columns in the first matrix must equal the number of rows in the second. If those inner dimensions differ, Excel returns #VALUE!. Write both shapes side by side and check the inner numbers match. The second cause is non-numeric content: every cell in both matrices must contain a number, so text, labels, blanks, or numbers stored as text will trigger the error. Confirm the shapes line up and all cells are numeric, and the calculation will succeed.
- Is MMULT the same as multiplying cells with an asterisk?+No, they are very different operations. Using an asterisk, such as A1*B1, multiplies matching cells one to one, which is element-wise multiplication. MMULT performs true matrix multiplication, where each result cell is the dot product of a whole row and a whole column. The two give different results and serve different purposes. Use the asterisk when you simply want to multiply corresponding values. Use MMULT for linear algebra tasks like applying weights, chaining transformations, or solving equation systems. Choosing the right one depends entirely on the calculation you actually need.
- How do I use MMULT to solve linear equations?+To solve a system written as A times x equals b, use the inverse of the coefficient matrix. First, place the coefficients in a square range and the answers in a column. Then compute the solution with =MMULT(MINVERSE(A1:C3), E1:E3), which multiplies the inverse of A by the column b. The result spills as a column holding the values of your unknowns. Before solving, check that =MDETERM(A1:C3) is not zero, because a zero determinant means the matrix is singular and cannot be inverted, so no unique solution exists.