With some thought you would be able to shorten the below but I suspect they do what you want:

G14:
=MAX(0,MIN(250000,SUM($G$13:G$13))-SUM($F14:F14))
copied across

G15:
=MAX(0,MIN(250000,SUM($G$13:G$13)-250000)-SUM($F15:F15))
copied across

G16:
=SUM(G$13)-SUM(G14:G15)
copied across