MMULT in Excel

Article byWallstreetmojo Team
Edited byAshish Kumar Srivastav
Reviewed byDheeraj Vaidya, CFA, FRM

What does MMULT Do in Excel?

MMULT, a Math & Trigonometry function in Excel, stands for “Matrix Multiplication.” It returns the product of two arrays of two matrices where the number of rows of Matrix 1 equals the number of columns of Matrix 2.

This function applies the logic of multiplying one Matrix by another Matrix using the “Dot Product” of rows and columns. For example, look at the two matrix tables in Excel.

MMULT Excel - Explanation 1

The above image has two matrix tables, Matrix 1 and Matrix 2. Multiplication of matrices is done using the “Dot Product” method of rows and columns. The first row of “Matrix 1” is multiplied by the first column of “Matrix 2.”

The first column of “Matrix 1” has three numbers. And the first row of “Matrix 2” has three numbers. So, the first number of “Matrix 1” columns will be multiplied by the first number of “Matrix 2” rows. Like this, all the values are multiplied. In the end, a summation of these values has arrived.

The MMULT function in Excel will also do it.

–>> If you want to learn Excel and VBA professionally, then ​Excel VBA All in One Courses Bundle​ (35+ hours) is the perfect solution. Whether you’re a beginner or an experienced user, this bundle covers it all – from Basic Excel to Advanced Excel, Macros, Power Query, and VBA.

Syntax

MMULT Syntax

This function has two arguments: Array 1 and Array 2.

  • Array 1 will be “Matrix 1” table values
  • Array 2 will be “Matrix 2” values.

One special note we all need to be aware of is that MMULT is an array function, so after selecting the “Matrix 1” and “Matrix 2” values, we need to close the formula as an array formula by pressing the “CTRL + SHIFT + ENTER” keys.

Array Formulas in excelArray Formulas In ExcelArray formulas are extremely helpful and powerful formulas that are used in Excel to execute some of the most complex calculations. There are two types of array formulas: one that returns a single result and the other that returns multiple results.read more closing keys.

Array Formula Keys

We know it isn’t easy to understand formula logic by just reading the theoretical part. But nothing to worry about because we will show you enough examples with proper explanations to understand better.

How to Use the MMULT Function in Excel? (with Examples)

You can download this MMULT Excel Template here – MMULT Excel Template

Example #1

Consider below two matrices for this example.

MMULT Excel - Example 1.1

By multiplying these two matrices, we will create “Matrix 3”. To apply the MMULT function, we need to decide the matrix table length. It is determined by the number of rows of “Matrix 1” and the number of columns of “Matrix 2.”

  • In this example, for “Matrix 1,” we have two rows. For “Matrix 2,” we have two columns. So, “Matrix 3” will be a 2 * 2 matrix. So, select 2 * 2 rows and columns to create a new “Matrix 3.”
MMULT Excel - Example 1.2
  • Step 1: First, we must open the MMULT function.
MMULT Excel - Example 1.3
  • Step 2: For Array 1 argument, select “Matrix 1” table values from A3 to C4.
MMULT Excel - Example 1.4
  • Step 3: For Array 2 argument, select “Matrix 2” table values from E3 to F5.
MMULT Excel - Example 1.5
  • Step 4: Then, close the bracket but do not press the “Enter” key straight away because this is an array formula. We must press the “Enter” key by holding the Ctrl and Shift keys together. When we close the formula, we get curly brackets by holding the “Ctrl + Shift + Enter” keys.
MMULT Excel - Example 1.6

So, we have got the result in “Matrix 3.”

If you are wondering how we got these values, we will explain them to you now.

The first row values of “Matrix 1” are “2, 1, 7,” the first column values of “Matrix 2” are “8, 8, 2,” and the first value of “Matrix 3” is “38”. It is achieved following the below equation.

  • =(2 * 8) + (1 * 8) + (7 * 2)
  • =16 + 8 + 14 
  • = 38

The second value in “Matrix 3” is 27, first row values of “Matrix 1” achieve this is “2, 1, 7” and second column values of “Matrix 2” is “3, 7, 2”.

  • =(2 * 3) + (1 * 7) + (7 * 2)
  • =6 + 7 + 14
  • = 27

Like this, MMULT performs its job.

Example #2

Now, look at the two equations.

Example 2.1 - Given

This time we have a 3 * 3 matrix so that the new matrix will be the number of rows of “Matrix 1” and the number of columns of “Matrix 2.” So the new “Matrix 3” will also be 3 * 3 matrix only.

Example 2.2 - Matrix Length
  • Now, we must apply the MMULT function.
Example 2.3 - Enter Formula
  • Then, we must press the “Ctrl + Shift + Enter” keys to get the result.
MMULT Result

Things to Remember

This article is a guide to the MMULT Function in Excel. We discuss how to use the MMULT function to get the multiplication of a matrix with examples and a downloadable Excel template. You can learn more from the following articles: –