Instead of using a UDF (user defined function) for number of 3 man teams and 4 man teams you could use the following formulas:
Number of players is in cell C1
Number of 3 man teams in cell C3: =MOD(4-MOD(C1,4),4) then
Number of 4 man teams in cell C4: =(C1-(C3*3))/4