# Lookup problem

#### rjc4

##### Well-known Member
Hi All,

Could anyone suggest a solution to this problem.

In R6 is the formula =average(J1:J50). This
cell is used as the lookup value for a table as listed below.

The table is in R1:S20+ and the values in the table are.
2.0 6
2.5 7
3.0 8
4.0 9
etc

The first column in the lookup table consists of numbers to one
decimal place BUT that place is ONLY .0 or .5

However, the value returned in R6 can be one decimal place of
any value. For example 2.1, 2.4, 3.9, 3.2 etc.

I wish to lookup the NEAREST value in the lookup table to that
returned in R6 and scoot across to column S and find that value.
So if R6 returned 2.1, the lookup table would find 6 but if it
was 2.4 in R6, the lookup would return 7.

2.6 in R6 would find 7 but 2.8 would get 8 as the 2.8 is closer to 3
than 2.5.

Is it possible to do this and if so how could it be done.

Cheers
R

### Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

For this example, I put the value to be looked up in P1:

Code:
``=LOOKUP(ROUND(P1/0.5,0)*0.5,R1:S20)``

Given your parameters, you could use something along the lines of
vlookup(ROUND(R6/0.5,0)*0.5,range,column,0)

Or ...

=LOOKUP(MROUND(R6,0.5),range_to_lookup)

Thank you Hotpepper IML and Yogi.
Sorry about the range. A typo, s/b R9......

But your formulas have worked fine.
Much appreciated!

Cheers
R

Replies
7
Views
570
Replies
3
Views
262
Replies
5
Views
190
Replies
8
Views
104
Replies
5
Views
205

1,203,605
Messages
6,056,244
Members
444,853
Latest member
sam69

### 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.

### Which adblocker are you using?

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

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