There is a mistake on B13, it should be MIN(B12;B7)

Ioannis