Excel min value greater than x returns 0 if no value found?

后端 未结 2 430
梦谈多话
梦谈多话 2021-01-15 10:29

I am using the following formula: =MIN(IF(A1:A5>B1,A1:A5)) use Ctrl-Shift-Enter My value for B1 is 10 and my array is {1,5,4,2,7} so in this case no value is greater than 1

2条回答
  •  醉话见心
    2021-01-15 10:53

    Your IF statement will return False if none of the numbers in the range are greater than 10. It appears that MIN is converting False to numeric (0). You need to add behavior to handle the False.

    If you know that all valid values must be >=0, then you could use the "else" section of the IF formula to return -1.

    MIN(IF(A1:A5>B1,A1:A5,-1))
    

提交回复
热议问题