I started playing with the formula to see if it could be simplified, and I notice a problem with your if-statements. In your third if-statement, do you mean "$B$4>=5"? I'm not sure why you have >4, since anything less than 5 will be skipped. But, if you mean >=5, the >4 will do the same thing...