I do have a sheet with multiple items. My aim is it to figure out the storage period of an item. Meaning how long has an item been in the warehouse from the time received to the time taken out (storage period)? We issue the items on the principle of first in first out.

See below an example.
I want to calculate the average days of the plugs being in the warehouse. We get 35 in on 1 Janunary and take 2 days later 30 out. Meaning that 5 still left from 1 January. On 5 Janunary the warehouse receives another 10 in. On 17 January 15 plugs are taken out. 5 out of the 15 had been stored for 16 days (17 January - 1 January) and the other 10 are stored for 12 days (17 January - 5 January).


Date Item Quantity Movement
1/1/2011 PLUG 35 In
1/3/2011 PLUG 30 Out
1/5/2011 PLUG 10 In
1/17/2011 PLUG 15 Out

1/2/2011 Stamp 40 In
1/3/2011 Stamp 30 Out
1/5/2011 Stamp 5 In
1/17/2011 Stamp 15 Out