ID EN
#Math

MMULT

Excel Functions

Perform matrix multiplication

Syntax

EXCEL
=MMULT(array1, array2)

Arguments

Parameter Description
array1 The first array to multiply.
array2 The second array to multiply.

Return Value

The matrix product of two arrays

Details

The MMULT function returns the matrix product of two arrays, sometimes called the "dot product". The result from MMULT is an array that contains the same number of rows as array1 and the same number of columns as array2. The MMULT function appears in certain more advanced formulas that need to process multiple rows or columns. For example, you can use MMULT with XLOOKUP to match a value in any column. The MMULT function takes two arguments, array1 and array2, both of which are required. The column count of array1 must equal the row count of array2. For example, you can multiply a 2 x 3 array by a 3 x 2 array to return a 2 x 2 array result. The MMULT function will return a #VALUE! error if array1 columns do not equal array2 rows. Note: In Excel 365, which supports dynamic arrays, MMULT spil

Examples

Example #1 - basic usage

In the example shown, the MMULT formula is evaluated like this:

EXCEL
=MMULT(B6:D7,F6:G8)
=MMULT({0,3,5;5,5,2},{3,4;3,-2;4,-2})
={29,-16;38,6}
Example #2 - count rows with specific value

In this example, the goal is to count rows that contain the number 90. The challenge is that the value might appear in any of several columns, and mig

EXCEL
=SUM(--(MMULT(--(data=90),TRANSPOSE(COLUMN(data)))>0))

See Also

SUMPRODUCT MUNIT MINVERSE MDETERM