Looks up values in a vector or array