One last thing: can you tell me what that expression mean ?
=ROUND(MAX(IF($W$8,MAX(0,SUM(H$12:H12)+G13-$W$9),0),IF($W$5,IF(G13>$W$6,G13-$W$6,0),0)),2)
=ROUND(MAX(0,$W$8*(SUM(H$12:H12)+G13-$W$9),$W$5*(G13-$W$6)),2)
By the way, the original
Code:=ROUND(MAX(IF($W$8,MAX(0,SUM(H$12:H12)+G13-$W$9),0),IF($W$5,IF(G13>$W$6,G13-$W$6,0),0)),2)
can be simplified to
Code:=ROUND(MAX(0,$W$8*(SUM(H$12:H12)+G13-$W$9),$W$5*(G13-$W$6)),2)
=ROUND(MAX(0,$W$8*(SUM(H$12:H12)+G13-$W$9),$W$5*(G13>$W$6)*(G13-$W$6)),2)
Hi, actually not: that is already caught by MAX(0 ...Shouldn't the simplification be :-
otherwise you lose the fact that G13 has to be greater than W6.Code:=ROUND(MAX(0,$W$8*(SUM(H$12:H12)+G13-$W$9),$W$5*(G13>$W$6)*(G13-$W$6)),2)
hth