View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.newusers
Peo Sjoblom
 
Posts: n/a
Default vlookup-Closest value

"unsorted"

--
Regards,

Peo Sjoblom

Portland, Oregon




"flummi" wrote in message
ups.com...
By default, if the first column of your lookup range is numeric and
sorted and the fourth parameter in your lookup is set to "true", Excel
will search for an exact match and return the requested value. If it
can't find an exact match it will give you the requested value (column)
of the highest value in column one that is less than the search value.

Here's an example:

=lookup(A1;F1:G5;2;true)

lookup search value
key from/to
10 00 - 9.999...
20 10 - 29.999...
30 20 - .....

So in order to achieve you result and use vlookup you would need to
redesign your lookup table to put the expected value in the proper
place

Your table (yours reads: anything greater than 4.9 and less than 5.1 =
75.12; but e.g 4.0 would result in #NA)

4.9 123.11
5.1 75.12
5.2 112.80

redesigned (this reads: anything from 0 upto but not including 4.9 =
123.11; anything from 4.9 upto but not including 5.1 = 75.12 etc)

0.0 123.11
4.9 75.12
5.1 112.80
5.2 ???
..

Hope this helps.

Hans