=SUM(B3:H3)-40,if(i4<"0","0")
=SUM(B3:H3)-40,if(i4<"0","0")
It won't work because you have a comma between 40 and if. Are you trying to subtract the value returned by the IF statement? What are you trying to do in the formula?
I think this is is the formula that you want:
=IF(SUM(B3:H3)-40<0,0,SUM(B3:H3)-40)