How to get a value in an array based on the sampled value

ok
Now i know.
thanks for the editing and instruction.