The MMULT function returns the matrix product of two arrays. The result is an array with the same number of rows as array1 and the same number of columns as array2.
Syntax
=MMULT(array1,array2)
Arguments
Argument  Description  

array1, array2  The arrays you want to multiply

Inputting Array Formulas: To input an array formula,
 highlight the range of cells for the function result,
 type the function into the first cell of the range, and
 press CTRLSHIFTENTER
Examples
A  B  C  D  E  F  G  H  I  

1  Product Quantity  
2  Customer  Widgets  Cogs  Sprockets  Formula  Result  Notes  
3  Buyer1  14  9  3  {=MMULT(B3:D4,A7:B9)}  $6,325  779  Column G is the sales to Buyer1 and Buyer2  
4  Buyer2  2  11  15  $9,525  2,195  Column H is the shipping weight of items sold to Buyer1 and Buyer2  
5  
6  Price  Weight  Product  
7  $200  4  Widgets  
8  $250  42  Cogs  
9  $425  115  Sprockets 
Note: The curly brackets, { and }, seen in the formulas in E2 and E7 are not entered by the user. Excel applies these to show the formula has been input as an array formula.
Common Function Error(s)
Problem  What went wrong  

#VALUE!  Occurs if either:


#N/A  Occurs in cells outside the range of the resulting matrix, e.g. in the example above, had we highlighted cells G5H5 while entering the MMULT function, those cells, not being part of the resulting matrix, will return the #N/A error 
The matrix product of two matrices is given by multiplying the elements of each row of matrix 1 with the elements of each column of matrix 2, to create a resulting matrix that has the same number of rows as matrix 1 and the same number of columns as matrix 2. For the following matrices:
The matrix product array of the two arrays above, A & B is calculated as:
where is the row number, and is the column number.
The following represents the matrix product calculation:
See Wikipedia for more information on matrix multiplication.