If I understand you correctly, you only want to show SUM(F3,G3) as the result of the IF statement if it is less than F5 and F5 is 50000. If so, try

=IF(G3<=F3,min(F3,abs(SUM(F3,G3))),0)