MMULT explanation plz

nbrcrunch

Well-known Member
Joined
Jan 1, 2003
Messages
2,062
I just read something posted by "C M" wherein he used SUMPRODUCT along with MMULT. I read all the samples I could find on the web about MMULT but just more confused than ever.

Using the simple examples like the ones in Excel help, i see the results but, even with the (terse) explanation, I do not understand how those results are arrived at. I tried using formula evaluation in a sample, but it goes from formula to resolution in a single step.

So in a 2 by 2 or 3 by 3 grid, how are the results being arrived at?

http://www.mrexcel.com/forum/showthread.php?t=365142

http://office.microsoft.com/en-us/excel/HP052091811033.aspx?pid=CH062528291033
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I just read something posted by "C M" wherein he used SUMPRODUCT along with MMULT. I read all the samples I could find on the web about MMULT but just more confused than ever.

Using the simple examples like the ones in Excel help, i see the results but, even with the (terse) explanation, I do not understand how those results are arrived at. I tried using formula evaluation in a sample, but it goes from formula to resolution in a single step.

So in a 2 by 2 or 3 by 3 grid, how are the results being arrived at?

http://www.mrexcel.com/forum/showthread.php?t=365142

http://office.microsoft.com/en-us/excel/HP052091811033.aspx?pid=CH062528291033

A bit of explanation in general and in regards to the quoted post:

Lets say you have two matrix:
A(1x4) and B(5x1)
meaning A has 1 row and 4 columns and B has 5 rows and 1 column.
In order for the matrix multiplication AxB to exist, the number of columns of the first matrix (A for AxB) should be equal to the number of rows of the second matrix (B for AxB).
As you can clearly see that 4 is not equal to 5, AxB does not exist. However BxA does exist because 1 equals 1.
The size of BxA = (# of rows of B x # of columns of A)

For the quoted post, MMULT returns an array consisting of 1 and 0 which is then multiplied to the corresponding dollar values. The array is formed by comparing the data dates and category with the date and category of interest.

Hope this helped.
 
Upvote 0
Hi c_m

Your logic is correct, I'd just like to add that, in terms of syntax, since you are multiplying 2 orthogonal vectors, excel accepts it directly. You could just write:

=SUMPRODUCT((A4:A10=C1)*(B3:E3=B1),B4:E10)
 
Upvote 0
Hi c_m

Your logic is correct, I'd just like to add that, in terms of syntax, since you are multiplying 2 orthogonal vectors, excel accepts it directly. You could just write:

=SUMPRODUCT((A4:A10=C1)*(B3:E3=B1),B4:E10)

Thanks pgc01, point noted.
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,120
Members
451,399
Latest member
alchavar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top