How to use MMULT function in Excel?

The `MMULT` function in Excel is used to perform matrix multiplication between two arrays. The result is another array that’s the product of the matrices. For `MMULT` to work, the number of columns in the first array must be equal to the number of rows in the second array.

Here’s how you can use the `MMULT` function:

Syntax

=MMULT(array1, array2)
  • array1: The first matrix (array) you want to multiply.
  • array2: The second matrix (array) you want to multiply.

Steps to Use MMULT

  • Prepare your data: Ensure that the two arrays (matrices) you want to multiply have the correct dimensions:
    • If `array1` is an m×n matrix, `array2` should be an n×p matrix. The resulting matrix will be m×p.
  • Select the Output Range: Before pressing Enter or Ctrl+Shift+Enter (for versions prior to Excel 365), you should select the range where you want the resulting matrix to appear. Make sure this range has enough rows and columns to fit the resulting m×p matrix.
  • Enter the Formula:
    • Click on the formula bar after selecting the output range and type `=MMULT(array1, array2)`, replacing `array1` and `array2` with the actual ranges of your matrices.
  • Array Formula:
    • In Excel 365, simply press Enter.
    • In earlier versions of Excel, after typing the formula, press `Ctrl+Shift+Enter` to confirm it as an array formula. Excel will automatically place curly braces `{}` around your formula.

Example

If you have the following matrices:

Matrix A (2×3):

| 1  2  3 |
| 4  5  6 |

Matrix B (3×2):

| 7  8  |
| 9 10 |
| 11 12 |

To multiply these matrices using `MMULT`:

|  58  64 |
| 139 154 |
  • Store Matrix A in `A1:C2`.
  • Store Matrix B in `E1:F3`.
  • Highlight a 2×2 range where you want the result to appear, such as `H1:I2`.
  • In the formula bar, type `=MMULT(A1:C2, E1:F3)`.
  • Press `Enter` (Excel 365) or `Ctrl+Shift+Enter` (earlier versions) to get:

Matrix multiplication like this is common in various fields like data analysis, engineering, and graphics, among others.

Unlock Your Potential

Excel

Basic - Advanced

Access

Access Basic - Advanced

Power BI

Power BI Basic - Advanced

Help us grow the project