MMULT Function – Matrix Multiplication in Excel & Google Sheets
Written by
Reviewed by
This tutorial demonstrates how to use the MMULT Function in Excel to return the matrix product of two arrays.
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)
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 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 in Google Sheets
The MMULT Function works exactly the same in Google Sheets as in Excel: