Number lookup match

Peter1973

Well-known Member
Joined
May 13, 2006
Messages
957
I am trying to look in A1:A100 for the number that is the closest to D1 and then return the value from the corresponding cell from B1:B100. If there are 2 numbers in A1:A100 that are the closest to D1 then return the corresponding number from B1:B100 from the first one it comes to.

Hope that makes sense

Any help appreciated
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
It's ugly but it works. The formula in D3 looks for the Number that is equal to or closest to those in the Numbers column and reports the corresponding Value that is highest in the list.

ABCD
2search for Number35
3closest Value900
4
5NumberValue
660100
720200
870300
920400
1040500
1131600
12100700
1330800
1436900
15101000
16801100
17301200
18701300
19201400
20701500
21371600
221001700
231101800
24201900
25702000
26502100
27902200
28202300
29302400
30602500
31502600
32702700
331002800
34602900

<colgroup><col style="width: 25pxpx"><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet12

Array Formulas
CellFormula
D3{=INDEX(B6:B34,MIN(IF(MIN(ABS(D2-A6:A34))=ABS(D2-A6:A34),(ROW(A6:A34)-ROW(A5)))))}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try to enter the {} manually yourself

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,680
Members
449,116
Latest member
HypnoFant

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top