简体   繁体   English

当结果为单个值时,Excel将关闭数组公式模式

[英]Excel turns off array formula mode when the result is a single value

I have the following Worksheet array formula 我有以下工作表数组公式

{=MMULT(INDEX(Range1,1,{2,3,4}), Range2)}

where Range1 is a 1x4 matrix, and Range2 is a 3x1 matrix. 其中Range1是1x4矩阵,而Range2是3x1矩阵。 I'd like the sum product of the horizontal vector and the vertical vector. 我想要水平向量和垂直向量的总和。

If my target range is a single cell, Excel strips away the array mode, and returned a #VALUE error because INDEX returns a 1x1 in the regular mode. 如果我的目标范围是单个单元格,则Excel将剥离数组模式,并返回#VALUE错误,因为INDEX在常规模式下返回1x1。

If my target range is a multi-cell range, it correctly calculates the sum and repeats for the entire range. 如果我的目标范围是多单元格范围,则它会正确计算总和并在整个范围内重复。

Is there any way to fix this? 有没有什么办法解决这一问题? and get rid of the wrong optimization? 并摆脱错误的优化?

I'd like the sum product of the horizontal vector and the vertical vector. 我想要水平向量和垂直向量的总和。

In stead of your formula, you can use the following: 可以使用以下内容代替您的公式:

=MMULT(OFFSET(Range1,0,1,1,3), Range2)

It does not require to be entered as an array formula, although it is accepted if you do so. 尽管您可以接受它,但它不需要作为数组公式输入。

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

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