0

I have the following table:

            Col A   B     C    D
Row 1      Rating   2     3    5
Row 2         3     0   0.89  0.96

I am currently doing a lookup function (=lookup(0.874,B2:D2,B1:D1)) but it's looking at the next smallest number closest to 0.874 in Row 2 (0) and returning a 2. I want it to actually look at which number it's closest to in Row 2, 0 or 0.89 (0.874 is closest to 0.89) and pick 3 from Row 1. How do I go about changing my function so I can get this to work?

If my lookup value was 0.95, the return number would be 5, and so on.

Any help will be greatly appreciated!

4

1 回答 1

2

你可以使用这个公式

=INDEX(B1:D1,MATCH(MIN(ABS(B2:D2-F1)),ABS(B2:D2-F1),0))

CTRL+ SHIFT+确认ENTER

其中 F1 包含您的查找值

ABS(B2:D2-F1)找到与您的查找值的绝对差异B2:D2,因此,如果您MATCH将那些与列表中的最小值相对,您将获得最接近 F1 的值的位置......并INDEX返回相应的值B1:D1

于 2013-10-25T21:43:19.647 回答