MMULT Function – Matrix Multiplication in Excel & Google Sheets

Written by

Editorial Team

Reviewed by

Steve Rynearson

Last updated on November 6, 2023

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

MMULT Main Function

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

MMULT in Google Sheets

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

MMULT Google Function

AI Formula Generator

Try for Free

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