Use INDEX MATCH to find greater than/equal to value

前端 未结 2 1857
忘了有多久
忘了有多久 2020-12-06 14:16

I\'ve been searching online and in Excel Help but cannot find whether this is possible.

Given a list of numbers, values and a search term, I need to find the value w

相关标签:
2条回答
  • 2020-12-06 14:59

    Your desired results appear a little inconsistent. Why is the desired result for 15 Orange but that for 63 Indigo?

    Are you in fact attempting to match based on whichever corresponding value is absolutely closest to the search value, whether below or above that value?

    If so:

    =INDEX(B4:B10,MATCH(TRUE,INDEX(ABS(A4:A10-B1)=MIN(INDEX(ABS(A4:A10-B1),,)),,),0))

    though that still won't differentiate between e.g. Orange and Yellow for a search value of 25 (though I'm not sure how you are considering 25 "closer" to 30 than 20 in any case).

    Regards

    0 讨论(0)
  • 2020-12-06 14:59

    Another method of doing this is to place the numbers and colours into a table, order numbers by highest to smallest and use the formula below:

    =INDEX(B4:B10,MATCH(B1,A4:A10,-1))
    
    0 讨论(0)
提交回复
热议问题