Identifying which range a number falls into

Viewed 111

Given a set number of ranges:

a =

    32225   52259
    52260   70794
    70795   91459
    91460   95409

And a single value x = 61450 - is there a way to determine within which range x falls without using a loop to check each possibility? The answer in this case would be 2 as 61450 falls within the second range.

2 Answers
Related