简体   繁体   English

在什么情况下不能使用SUMPRODUCT代替MMULT?

[英]In what situations can't I use SUMPRODUCT instead of MMULT?

According to the Microsoft documentation, MMULT returns the matrix product of two arrays while SUMPRODUCT multiplies corresponding components in the given arrays, and returns the sum of those products. 根据Microsoft文档, MMULT返回两个数组的矩阵乘积,而SUMPRODUCT将给定数组中的对应分量相乘,并返回这些乘积的总和。

I don't see in what situations I cannot use SUMPRODUCT instead of MMULT . 我看不到在什么情况下不能使用SUMPRODUCT而不是MMULT And I missing something? 我错过了什么吗?

SUMPRODUCT only allows you to operate on same sized arrays to get a single result. SUMPRODUCT仅允许您对相同大小的阵列进行操作以获得单个结果。

MMULT can multiply differently sized arrays (as long as the rules are followed) to give you an array result. MMULT可以乘以大小不同的数组(只要遵循规则)即可为您提供数组结果。

The rule is that the first argument of MMULT must have as many columns as the second argument has rows, so you can use this formula, for example 规则是MMULT的第一个参数必须具有与第二个参数具有行一样多的列,因此可以使用此公式,例如

=MMULT(A3:C6,E3:E5)

where the first array is 4*3 (4 rows by 3 columns) and the second argument is 3*1 (3 rows by 1 column) and that returns a 4*1 array 其中第一个数组是4 * 3(4行乘3列),第二个参数是3 * 1(3行乘1列),并返回4 * 1数组

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM