# How to Do Matrix Multiplication in Excel (5 Examples)

## Method 1 – Performing Matrix Multiplication of Two Arrays in Excel

Let’s take two individual matrices A and B. In Excel, we will treat them as arrays for matrix multiplication.

Steps:

• Select the cells you want to put your matrix in.

• Enter the following formula:

`=MMULT(B5:D7,B10:D12)`

• Press Ctrl+Shift+Enter to get the result of the AxB matrix.

You can do the same for the BxA matrix by entering matrix B as the first argument and matrix A as the second argument of the MMULT function.

## Method 2 – Multiplying One Column with One Row Array

The following dataset with matrices contains only one column and one row.

Steps:

• Select the range of cells for the multiplied matrix.

• Enter the following formula:

`=MMULT(B5:B7,B10:D10)`

• Press Ctrl+Shift+Enter for the result.

Read More: How to Multiply Multiple Cells in Excel

## Method 3 – Conducting One Row and One Column Array Multiplication in Excel

Steps:

• Select one cell.

• Enter the following formula:

`=MMULT(B10:D10,B5:B7)`

• Press Ctrl+Shift+Enter for the result.

Read More: How to Multiply Rows in Excel

## Method 4 – Calculating Square of a Matrix from Matrix Multiplication

Steps:

• Select the range of cells.

• Enter the following formula:

`=MMULT(B5:D7,B5:D7)`

• Press Ctrl+Shift+Enter for the result.

You can replace the range of matrix A with the range of matrix B (B10:D12) to get the square of matrix B.

## Method 5 – Doing Multiplication of a Matrix and a Scalar in Excel

Steps:

• Select the range of cells.

• Enter the following formula:

`=B5:D7*G7`

• Press Ctrl+Shift+Enter for the result.

## Errors While Doing Matrix Multiplication in Excel

Look out for errors when applying matrix multiplication in Excel.

A common one is the #VALUE! error. This happens when the number of columns in the first array doesn’t match the number of rows in in the second array.

You will get the same #VALUE! error if there is at even one non-numeric value in a cell within the array.

If you select more cells than what the multiplied matrix should be, you will get the #N/A error in the extra cells.

## Related Articles

<< Go Back to Multiply in Excel

Get FREE Advanced Excel Exercises with Solutions!
Abrar-ur-Rahman Niloy

Abrar-ur-Rahman Niloy, holding a B.Sc. in Naval Architecture and Marine Engineering, has contributed to Exceldemy for nearly 1.5 years. As a leader in Excel, VBA, and Content Development teams, he authored 114+ articles and assisted the Exceldemy forum. Presently, as a project writer, he prioritizes stepping out of his comfort zone, aiming for constant technical improvement. Niloy's interests encompass Excel & VBA, Pivot Table, Power Query, Python, Data Analysis, and Machine Learning libraries, showcasing his commitment to diverse... Read Full Bio

We will be happy to hear your thoughts

Advanced Excel Exercises with Solutions PDF