Assuming your table is in A1:E4, B5 could have =MIN(SUM(B2:B4),15) and C5 could have =MIN(SUM($B$2:C4)-SUM($B$5:B5),15), dragged over for D5 and E5.