简体   繁体   中英

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. 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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