Thank you much for your prompt reply.
I tried to apply your formula, but the answers are not the same .
The answers should be as follows as working with the first in first ou
method.(what enters first ,leaves out the first ) while i need th
remaining sold each time :
D3= 80 E3= A2
D4=30 E4= A2
D5=30 E5= A2
D6=40 E6= A5
D7=40 E7= A5
D8=10 E8= A7
You can see that after crediting 20 in B3, D3 shows that we still hav
80 to consume from the first debit which is 100 ; in the E3 Cell i
reads "A2" which means that the first debit value we refer to is o
cell A2.
Then after crediting 50 in B4, D4 shows that we still have 30 t
consume from the first debit which is 100 and A2 is the debit value w
refer to, and so on until in D6 , we see that by crediting 40 w
already consumed the remaining 30 of the first debit (100) and als
consumed 10 of the second debit (50) and by that the answer is 40 whic
means that now we have 40 to consume of the second debit (50) , whil
the cell E6 return A5 which refers to the debit (50) and which the sol
refers to.
I can mail the sheet if that may clarify a little bit.
Thank you so much for your support