Hello guys nice to join this forum

Happy New Year to all.
Now basically i need to create 2 simple formula (i think so)..
The first one is when i put a number (X) i want to return the min and max value from a table witch it fits in ( A and B) please check the screenshots atached.
The second formula after achieving the first one i want for the min value to return the near cell value (factor 2)...
Please i remind you that i want to do all above things as an array .. i dont know if you understand what i want...
Thnak you in advace!