View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
hankach[_4_] hankach[_4_] is offline
external usenet poster
 
Posts: 1
Default A mysterious if function to return a specific balance?


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 out
method.(what enters first ,leaves out the first ) while i need the
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 have
80 to consume from the first debit which is 100 ; in the E3 Cell it
reads "A2" which means that the first debit value we refer to is of
cell A2.
Then after crediting 50 in B4, D4 shows that we still have 30 to
consume from the first debit which is 100 and A2 is the debit value we
refer to, and so on until in D6 , we see that by crediting 40 we
already consumed the remaining 30 of the first debit (100) and also
consumed 10 of the second debit (50) and by that the answer is 40 which
means that now we have 40 to consume of the second debit (50) , while
the cell E6 return A5 which refers to the debit (50) and which the sold
refers to.

I can mail the sheet if that may clarify a little bit.

Thank you so much for your support !




--
hankach