Excel Matrix Multiplication

What is Matrix Multiplication on Excel?

In excel we have an inbuilt function for matrix multiplication and it is MMULT function, it takes two arrays as an argument and returns the product of two arrays, given that both the arrays should have the same number of rows and the same number of columns.


Matrix multiplication is one of the useful features of excelUseful Features Of ExcelThe top features of MS excel are - Shortcut keys, Summation of values, Data filtration, Paste special, Insert random numbers, Goal seek analysis tool, Insert serial numbers etc. read more presented to do mathematical operations. It helps to gain the product of two matrices. The matrices that want to multiply have a certain number of rows and columns to present the data. The size of the resulted matrix is taken from the number of rows of the first array and the number of columns of the second array. There is a condition to matrix multiplication; the number of columns in the first matrix should be equal to the number of rows in the second matrix.

To perform the matrix multiplication, the predefined MMULT function presented in the excel software is used. Excel matrix multiplication reduces a lot of time incurred in calculating the product of matrices manually.

In general, matrix multiplication is done in two ways. Simple scalar multiplication is performed by using the basic arithmetic operations, and advanced matrices multiplication is managed with the help of array function in excelArray Function 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.

The Excel formula used for multiplicationExcel Formula Used For MultiplicationMultiplication in excel is performed by entering the comparison operator “equal to” (=), followed by the first number, the “asterisk” (*), and the second number.read more is entered in two ways, including manually typing MMULT function after the equal sign or selecting the Math and Trig function library presented under the ‘Formulas’ tab. The mathematic function MMULT helps in returning the multiplication of two arrays. It is one of the predefined excel functionsExcel FunctionsExcel functions help the users to save time and maintain extensive worksheets. There are 100+ excel functions categorized as financial, logical, text, date and time, Lookup & Reference, Math, Statistical and Information functions.read more used in worksheets to perform calculations in a short time.

Excel Matrix Multiplication

You are free to use this image on your website, templates etc, Please provide us with an attribution linkHow to Provide Attribution?Article Link to be Hyperlinked
For eg:
Source: Excel Matrix Multiplication (wallstreetmojo.com)


The required syntax that should be followed for the matrix multiplication is that

matrix multiplication syntax
  • Parameters: Array1 and Array2 are the two parameters required to do multiplication
  • Rule: Columns of array1 should be equal to rows of array2, and the size of the product is equal to the number of rows in array1 and number of columns in array2
  • Returns: The MMULT function generates the numbers in the product matrix. It is entered as a formula or worksheet function in excel calculations.


matrix multiplication explanation

Then the product of A*B is as follows.

matrix multiplication explanation1

How to do Matrix Multiplication in Excel? (with Examples)

Matrices multiplication in excel has some real-time application. There are two ways to do matrix multiplication. Below are some examples of the Excel Matrix Multiplication.

You can download this Matrix Multiplication Excel Template here – Matrix Multiplication Excel Template

Example #1 – Multiplying a matrix with a scalar number.

Lets start.

  1. First of all, data should be entered into the array.

    matrix multiplication example 1.1

  2. Select a scalar value that we are going to multiply with an array, i.e., 3

    matrix multiplication example 1.2

  3. Estimate the rows and columns of the resultant array. Here resultant array will be of size 3 x 3.

  4. Select the range of cells equal to the size of the resultant array to place the result and enter the normal multiplication formula.

    matrix multiplication example 1.3

  5. Once you enter the formula, press Ctrl + Shift + Enter. And the result will be obtained, as shown in the below-mentioned figure.

    matrix multiplication example 1.4

Example #2 – Matrix Multiplication of Two Individual Arrays

  • Step 1: First of all, data should be entered into array A size of 3×3
matrix multiplication example 2.1
  • Step 2: Enter data into the second array called B size of 3×3
matrix multiplication example 2.2
matrix multiplication example 2.3

Enter the values to calculate the Product of A & B.

matrix multiplication example 2.4

Once you enter the formula, press Ctrl + Shift + Enter to get the result. The results obtained by multiplying two arrays as follows, and the size of the resultant array is 3X3.

matrix multiplication example 2.5

Example #3

Matrix Multiplication between arrays with a single row and single column. Let consider the elements of matrices as

matrix multiplication example 3.1

Matrix A is of 1×3, and matrix B is of 3×1. The size of the product A*B [AB] matrix is 1×1. So Enter the Matrix Multiplication formula in the cell.

matrix multiplication example 3.2

Press Enter to get the result.

matrix multiplication example 3.3

Example #4 – Matrix Multiplication Between Arrays with Single Column and a Single Row

matrix multiplication example 4.1

Matrix A is of 3×1, and matrix B is of 1×3. The size of the product A*B [AB] matrix is 3×3.

matrix multiplication example 4.2

So, the answer will be,

example 4.3

Example #5 – Determining the square of a matrix using MMULT in ExcelMMULT In ExcelMMULT is an in-built Math & Trigonometry function in Excel that performs matrix multiplication of 2 arrays where the columns of Array 1 are equivalent to the rows for Array 2. read more

example 5.1

The square of matrix A is determined by multiplying A with A.

example 5.2

The resulting matrix is obtained as

example 5.3

Things to Remember

  • To perform matrix multiplication, the number of columns presented in the array1 and the number of rows presented in the array2 are equal.
  • It is hard to change the part of an array since the array is a group of elements.
  • While performing an array multiplication, CTRL+SHIFT+ENTER should be used to produce all elements of the result matrix. Otherwise, only a single element is produced.
  • The elements of an array should not be null, and text should not be used in matrices to avoid errors.
  • The size of the product array is equal to rows of the first array and columns of the second array.
  • Multiplication of A*B is not equal to the multiplication of B*A in matrix multiplication.
  • Multiplying a matrix with unit matrix results in the same matrix (i.e. [A]*[Unit matrix]=[A])

Recommended Articles

This has been a guide to Excel Matrix Multiplication. Here we discussed how to do Matrix Multiplication in Excel using Scalar Method and MMULT() Function with examples and a downloadable excel template. You can learn more about excel from the following articles –

  • 35+ Courses
  • 120+ Hours
  • Full Lifetime Access
  • Certificate of Completion