简体   繁体   English

Excel中的表设置和MMult功能

[英]Table setup and MMult funtion in Excel

I have the following problem using MMult function in Excel. 我在Excel中使用MMult函数有以下问题。

Unfortunately, I cannot post pictures here because I am new to the forum, sorry for that. 不幸的是,我不能在这里发布图片因为我是论坛新手,对不起。 So here is the link for the picture I refer to: https://postimg.org/image/k4zh64puz/ 所以这里是我所指的图片的链接: https//postimg.org/image/k4zh64puz/

在此输入图像描述

I have a big table set up in the format the B1:E2 table in the picture has. 我有一个大表格,图中的B1:E2表的格式。 When I use the transpose formula in A4, it give me the value in B4, which is wrong . 当我在A4中使用转置公式时,它给出了B4中的值,这是错误的

When I set up the table in a vertical format as in table B6:C9, the function in A11 gives the right solution to the MMult calculation, like in B11. 当我按照表B6:C9中的垂直格式设置表格时,A11中的函数为MMult计算提供了正确的解决方案,就像在B11中一样。

Any idea on how I can achieve the green result with the B1:E2 table ? 有关如何使用B1:E2表格获得绿色结果的任何想法?

Many thanks in advance. 提前谢谢了。

With Excel's MMULT 使用Excel的MMULT

"The number of columns in Array1 must be the same as the number of rows in Array2." “Array1中的列数必须与Array2中的行数相同。”

So in your second example the first array must be transposed since it contains rows instead of columns. 所以在你的第二个例子中,第一个数组必须被转置,因为它包含行而不是列。 The second array must not be transposed since it contains rows already. 第二个数组不能转置,因为它已包含行。

{=MMULT(TRANSPOSE(C6:C9),B6:B9)}

In your first example the second array must be transposed since the first array contains columns already but the second array contains also columns while it should contain rows. 在第一个示例中,第二个数组必须转置,因为第一个数组已包含列,但第二个数组也包含列,而它应包含行。

So in your first example: 所以在你的第一个例子中:

{=MMULT(B1:E1,TRANSPOSE(B2:E2))}

Since your Excel seems to have semicolon as formula parameter separator: 由于您的Excel似乎有分号作为公式参数分隔符:

{=MMULT(B1:E1;TRANSPOSE(B2:E2))}

The formulas must be entered as array formulas. 公式必须作为数组公式输入。 So make sure to press CTRL+SHIFT+ENTER after typing the formula. 因此,请确保在键入公式后按CTRL + SHIFT + ENTER。

In this concrete example the MMULT would work as an ordinary formula if no transposing would be necessary since the result is a 1 x 1 matrix only. 在这个具体的例子中,如果不需要转置,MMULT将作为普通公式工作,因为结果只是1 x 1矩阵。 But TRANSPOSE needs to be in array context in any cases. 但是在任何情况下, TRANSPOSE都需要在数组上下文中。

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

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