A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
cMatrix is not a 1x1 matrix, your conclusion is wrong, see screenshot below.
E2:F3: {=MMULT(B2:C3,B6:C7)}
E6:F7: {=MMULT(E2:F3,TRANSPOSE(B2:C3))}
Please read the description section in the article I mentioned:
"The result is an array with the same number of rows as array1 and the same number of columns as array2."
If you want the top left item of cMatrix and always ignore the others, try this code:
Function MatrixMulta(ByVal aMatrix As Range, ByVal bMatrix As Range, ByVal cl As Double, ByVal price As Double)
Dim cMatrix As Variant
With WorksheetFunction
cMatrix = .MMult(.MMult(aMatrix, bMatrix), Application.Transpose(aMatrix))
cl = .Norm_S_Dist(cl, True)
End With
MatrixMulta = Sqr(cMatrix(1, 1)) * cl * price
End Function
Andreas.