View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
[email protected] Nikolay.V.Petrov@gmail.com is offline
external usenet poster
 
Posts: 4
Default Return value from list based on criteria

I have two numbers - X and Y.

I want to get value from a sorted list, based on how close Y is to X.
Values in the list are let's say from 1 to 5.

The values X and Y are between same min/max ranges.

Example:
X=5
List values: 1,2,3,4,5
Min is 0
Max is 100


If Y=50 the returned value should be 5
If Y=25 or 75, the returned value should be 3
If Y=10 or 90, the returned value should be 1
and so on.

any ideas how to emplement?

thanks in advance