This expression

Sgn(No1-YourNum) + Sgn(No2-YourNum)

enumerates all 5 possibilities:

Your number less than the minimum of No1, No2

Your number is equal to the minimum of No1, No2

Your numer is between No1 & No2

Your number is equal to the maximum of No1, No2

Your number greater than the maximum of No1, No2