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)

How to Do Matrix Multiplication in Excel

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

How to Do Matrix Multiplication in Excel

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.

How to Do Matrix Multiplication in Excel


Method 2Multiplying 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.

How to Do Matrix Multiplication in Excel

  • Enter the following formula:

=MMULT(B5:B7,B10:D10)

How to Do Matrix Multiplication in Excel

  • Press Ctrl+Shift+Enter for the result.

How to Do Matrix Multiplication in Excel

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)

How to Do Matrix Multiplication in Excel

  • Press Ctrl+Shift+Enter for the result.

How to Do Matrix Multiplication in Excel

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)

How to Do Matrix Multiplication in Excel

  • Press Ctrl+Shift+Enter for the result.

How to Do Matrix Multiplication in Excel

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

How to Do Matrix Multiplication in Excel


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

How to Do Matrix Multiplication in Excel

  • Press Ctrl+Shift+Enter for the result.

How to Do Matrix Multiplication in Excel


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.

How to Do Matrix Multiplication in Excel

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.

How to Do Matrix Multiplication in Excel


Download Practice Workbook


Related Articles


<< Go Back to Multiply in Excel | Calculate in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Abrar-ur-Rahman Niloy
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

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo