I am trying to find a way in excel to replace the value in a cell if the number in a pervious cell is less or more then the value in the cell

IE. the value of the cell in H4 is 26 the value in L4 is 46 If the value in H4 is less then L4 I need it to replace the number in L4 with the lower number

also to go the other way as well for another cell

IE. the value of H4 is 26 the value of M4 is 23 If the value in H4 is more then M4 I need it to replace the number in M4 with the higher number

in example 1 if the number in H4 is Higher then L4 then don't change the lower number

in example 2 if the number in H4 is Lower then L4 then don't change the higher number


Is that possible to do
Thanks in advance
Akanu