Dear Members and Moderators,
Good day to you.

Please help me on this
I have two worksheet named Commitment and Purchase
Commitment Sheet contains the following Data
Commitment No Quantity Price
1 5000 100.00
2 5000 101.00
3 10000 101.50
Purchase Sheet Contains Following Data
Date Quantity Price
02/01/2012 4820
03/01/2012 4000
04/02/2012 7010
Price to be calculated from commitment sheet
for example price for 4820 kgs equal to 100.00 and price for 4000 kgs to splitted to first and second commitment that is remaining commitment of 5000 is 180 kgs @ 100.00 balance of 3820 kgs @ 101.00 so second commitment balance is 1180.00

Can any body help me to calculate the same