Lookup problem

rjc4

Well-known Member
Joined
Nov 6, 2004
Messages
502
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.

Thanks in advance.
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.
You know your formula is in your table range???

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

Code:
=LOOKUP(ROUND(P1/0.5,0)*0.5,R1:S20)
 
Upvote 0
Given your parameters, you could use something along the lines of
vlookup(ROUND(R6/0.5,0)*0.5,range,column,0)
 
Upvote 0
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 :biggrin: :biggrin:
 
Upvote 0

Forum statistics

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