The LOOKUP¨function looks for the value TODAY()-M2 ( length of service) in the first range ( callled Lookup_vector).
If not found it looks for the first number larger than said value, and returns the value with the same position in the second range( called result_vector).
For this to work values in the lookup_vector
must be placed in ascending order.
This link will also help.
An INDEX/MATCH combination might also work