Get the closest or next value from a data range