Matrix multiplication means multiplications of two different arrays, 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 in Excel (Table of Contents)**

## What is Matrix Multiplication on Excel?

Matrix multiplication is one of the useful features of excel 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 are managed with the help of array functions.

### Explanation of Matrix Multiplication in Excel

The Excel formula used for multiplication is entered in two ways including manually typing MMULT function after the equal sign or selecting 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 function used in worksheets to perform calculations in a short time.

### Matrix Multiplication Excel Syntax

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

**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.

Consider,

Then the product of A*B is as follows

### How to do Matrix Multiplication in Excel?

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

#### Example#1

Multiplying a matrix with a scalar number.

**Step1:** First of all data should be entered into the array

**Step2:** Select a scalar value that we are going to multiply with array i.e. 3

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

4.9 (1,353 ratings)

**Step4:** Select the range of cells equal to the size of the resultant array to place the result and enter the normal multiplication formula

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

#### Example#2

Matrix Multiplication of two individual arrays

**Step1:** First of all data should be entered into array A size of 3×3

**Step2:** Enter data into the second array called B size of 3×3

**Step3:** We needs to ensure that columns of the first array are the same in size to rows of the second array

**Step4:** Estimate the rows and columns of the resultant array.

**Step5:** Select the range of cells equal to the size of the resultant array to place the result and enter the MMULT multiplication formula.

Enter the values to calculate Product of A & B.

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.

#### Example#3

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

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

Press Enter to get the result.

#### Example#4

Matrix Multiplication between arrays with single Column and a single row

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

So, the answer will be,

#### Example #5

Determining the square of a matrix using MMULT function

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

The resulting matrix is obtained as

**Example #6**

Matrix Multiplication is widely is used in the determination of sales and overall weight of products sold to the customers. The use of matrix multiplication is real life applications explained by the following example.

In this example, matrix multiplication is used to determine the sales generated in selling different items books, pens, and pencils to two customers and a total weight of the items sold to each customer. Quantity of items, price, and weight are shown in the matrix format.

Size of quantity matrix and price and weight matrix are 2×3 and 3×2 respectively. Sales and total weights have resulted in the matrix size of 2×2. The results will be obtained as shown in the below-mentioned figure.

Press Ctrl + Shift + Enter to get the answer.

To produce all the results properly, the formula should be used as an array formula shown in the figure. In this way, matrix multiplication is used in the determination of sales generated in a business.

### Things to Remember

- To perform matrix multiplication, a number of columns presented in the array1 and 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 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
- Size of product array is equal to rows of 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 downloadable excel template. You can learn more about excel from the following articles –

- Inverse Matrix in Excel
- Arrays Function in VBA
- VBA COUNTIF Function
- VBA ISNULL
- How to Add Bullet Points in Excel?
- Using VBA Arrays
- Use SUMPRODUCT with Multiple Criteria
- Use Pivot Table From Multiple Sheets
- Use COUNTIF with Multiple Criteria

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