WorksheetFunction.MMult Method

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.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Function MMult ( _
    Arg1 As Object, _
    Arg2 As Object _
) As Object
'Usage
Dim instance As WorksheetFunction
Dim Arg1 As Object
Dim Arg2 As Object
Dim returnValue As Object

returnValue = instance.MMult(Arg1, Arg2)
Object MMult(
    Object Arg1,
    Object Arg2
)

Parameters

  • Arg1
    Type: System.Object

    Array1, array2 - the arrays you want to multiply.

  • Arg2
    Type: System.Object

    Array1, array2 - the arrays you want to multiply.

Return Value

Type: System.Object

Remarks

The number of columns in array1 must be the same as the number of rows in array2, and both arrays must contain only numbers.

Array1 and array2 can be given as cell ranges, array constants, or references.

MMult returns the #VALUE! error when:

Any cells are empty or contain text.

The number of columns in array1 is different from the number of rows in array2.

The size of the resulting array is equal to or greater than a total of 5,461 cells.

The matrix product array a of two arrays b and c is:

Figure1: Matrix product array a of two arrays b and c

Matrix product array a of two arrays b and c

where i is the row number, and j is the column number.

Formulas that return arrays must be entered as array formulas.

See Also

Reference

WorksheetFunction Interface

WorksheetFunction Members

Microsoft.Office.Interop.Excel Namespace