Hi,
The first step is to link the Week1 cell to the Number to subtract per week using this formula:
=A2
The second step, use this formula in Week2 and drag it to the right:
IF(SUM($D2:D2,$A2)<=$B2,$A2,IF($B2-SUM($D2:D2)=0,"",$B2-SUM($D2:D2)))

Regards,
Haytham