Finding a range

This may be overkill, but I believe this post will lead you in the right direction: