=Lookup(2,1/(A1:A5<=X1),A1:A5)

That formula will do both.

It finds the last value that is less than or equal to the input value (in X1)