Excel MMULT Function
The Excel MMULT function returns the matrix product of two arrays. The array result has the same number of rows as array1 and the same number of columns as array2.
The MMULT function will return the matrix product of two arrays.
1. Array1 and Array2 can be given as cell ranges, array constants or references.
2. The MMULT function will return #VALUE! Error value when:
- There are empty cells or text cells in the two arrays;
- The number of columns in Array1 is different from the number of rows in Array2.
3. This MMULT function must be entered as an array formula by pressing the Ctrl + Shift + Enter keys.
Supposing you have two number arrays as below screenshot shown, and you need to return the matrix product of these two arrays with the MMULT function, here shows you step by step to achieve it.
1. Please select a range with 2 cells wide and high.
Note: As the above screenshot shown, array1 has 2 rows, array2 has 2 columns, so the result array has 2 rows and 2 columns.
2. Copy the below formula into the selected cells and then, press the Ctrl + Shift + Enter keys simultaneously to get all the array results at the same time.
- B4:D5 is the range of the first array, and F4:G6 is the range of the second array. You can change them based on your needs.
- If the selected cells are more than 2 rows and 2 columns, #N/A error will be returned in those additional cells.