I've only been using excel for a week and this was the first formula that returned the result I was after.
before you replied I got it to work like this =IF(AND(M3=0),0,IF(AND((M3-S3)*(A3-0.58)<0),0,(M3-S3)*(A3-0.58)))
I guess there is a shorter way to write the same
I'll go back and try to use the =max
The reason I used AND(M3=0),0, is because when M3 is a zero the formula is multiplying a negative by a negative which is obviously a positive. In this case it means an employee being paid extra when he did not work, AND(M3=0),0, stops this from happening