With the last sample I posted does this work?

=SUM(MIN(CEILING(Purchase!B3,1000),A3)*B2,MAX(0,MIN(CEILING(Purchase!B3,1000)-A3,(A4-A3)))*B3,MAX(0,MIN(CEILING(Purchase!B3,1000)-A4,(A5-A4)))*B4,MAX(0,MIN(CEILING(Purchase!B3,1000)-A5,(A5:A6)))*B5,MAX(0,MIN(CEILING(Purchase!B3,1000)-A6,(A6:A7)))*B6,MAX(0,(CEILING(Purchase!B3,1000)-A7))*B7)/1000
you will have to adjust to your new references.