Return to List of Excel Functions

MMULT Function – Matrix Multiplication in Excel & Google Sheets

This Tutorial demonstrates how to use the Excel MMULT Function in Excel returns the matrix product of two arrays.

MMULT Main Function

MMULT Function Overview

The MMULT Function returns the matrix product of two arrays.

To use the MMULT  Excel Worksheet Function, select a cell and type:

MMULT Function

(Notice how the formula inputs appear)

MMULT Function Syntax and Inputs:

=MMULT(array1,array2)

array1 – The first array to multiply.

array2 – The second array to multiply.

Matrix Product

In Excel, the PRODUCT Function can multiply two arrays element by element. However, matrix multiplication is different from elemental product. The MMULT Function multiplies the rows with their corresponding columns therefore the number of rows of a matrix must be equal to the number of columns of the second matrix.

The example of elemental multiplication of arrays is explored in detail. Click here to learn more. 

MMULT Function

The MMULT Function returns the matrix product of two given arrays if the number of rows of the first array is equal to the number of columns of the second array.

=MMULT(A2:B3, A6:B7)

MMULT 01

Excel 2019 and Earlier: After entering the formula, instead of pressing ENTER, you must press CTRL + SHIFT + ENTER. This turns the formula into an array. You can identify arrays by the curly brackets surrounding the formula

{=MMULT(A2:B3, A6:B7)}

 

Important: You can not manually type in the curly brackets, this will not work. You must use CTRL + SHIFT + ENTER

Excel 365 and Newer Versions of Excel:. In newer versions, you no longer need to use CTRL + SHIFT + ENTER. You can simply press ENTER. 

MMULT Function – Unequal Rows & Columns

The MMULT Function will return an error if the rows of the first matrix are not equal to the columns of the second matrix.

= MMULT(A2:B3, A6:B8)

MMULT 02

 

MMULT Function – Text or Empty Cell

The MMULT Function will also return an error if any member of any array is either empty or contains some text.

=MMULT(A2:B3, A6:B7)

MMULT 03

Easy Excel Automation

Add Excel automation to your workbook with just a few clicks.

Learn More

MMULT in Google Sheets

The MMULT Function works exactly the same in Google Sheets as in Excel:

MMULT Google Function

Excel Practice Worksheet

practice excel worksheet

Practice Excel functions and formulas with our 100% free practice worksheets!

  • Automatically Graded Exercises
  • Learn Excel, Inside Excel!

Free Download

Return to List of Excel Functions