N
Nikolay.V.Petrov
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
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