Excel: What determines evaluation order in a formula?

前端 未结 4 1582
Happy的楠姐
Happy的楠姐 2020-12-17 22:53

I have a worksheet with the following contents in A1:G1

7  8  4  2  9  11  10

Formula

=SUMPRODUCT(MIN($B1:$G1-$A1)) (1)
         


        
4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-17 23:35

    Summarizing the comments by Brad and barry houdini (originally this):

    The documentation says the ABS takes a number as its input, that MIN takes an arbitrary number of numbers, and SUMPRODUCT takes an arbitrary number or arrays. Seems like when the ABS is nested so deep it defaults to taking the number and can't figure out how to return an array.

    So to counteract that we can use INDEX round ABS and get the correct result without "array entry" and without SUMPRODUCT, i.e. =MIN(INDEX(ABS($B1:$G1-$A1),0)).

    This shows the right way of entering the formula, and it explains the cause of the error.

提交回复
热议问题