Cumulative production that stops once order qty met

Hello,

Using the data below I need to take the quantity 8600 and break it out into qty per hour using the throughput shown. Once the sum of the quantities (cumulative production) is equal to the total quantity (8600) I want it to stop adding. As you can see in the example below it went too high to 9000. I want it to stop once it hits 8600 and all subsequent time periods will show 0.

QTY Throughput 6am 7am 8am 9am 10am 11am
8600 30 1800 3600 5400 7200 9000

I've tried all kinds of different if statements, but no such luck. I would greatly appreciate some help.

Thank you so much,
AW

AttachmentSize
excel help hourly prod.xlsx12.09 KB