Adrian Ghaui
New Member
Hi All
I've been grappling with this for a long time and would really appreciate any help. Many, many hours have been spent trawling help, books this forum and others but to no avail yet.
I will use the fictitious example of Acme distilleries to illustrate the problem. To anyone who may want to help but is offended by the alcohol reference, sorry, and please be assured that the real world application for this has nothing to do with making alcohol.
Let's say Acme wants to know the average age of it's total stock of wine/whiskey/moonshine that is ageing in barrels. Each year some will be removed from barrels (always the oldest) and new stock will be introduced. When the distillery is expanding, new barrels are purchased. After a point the distillery is at peak capacity and any new stock is only put into barrels from which that year's 'harvest' is taken out.
The key figure is the average age of the overall volume of liquid in barrels.
The amount being taken out will not be limited to a certain age. EG in one year more than the oldest 1 year's worth of liquid can be removed.
I'm looking for a non VBA solution to this:
I need a function that will look at the amount being removed from barrels (the oldest stock) and subtract this from the total stock.
Then I need the change in volume of stock per year to reflect this in the calculation of the average age of all remaining stock including the addition of the new liquids for that year.
The attached document shows my progress. I'm close, but may be overlooking something obvious/more eloquent. Please take a look and let me know your thoughts.
Thanks very much!
I've been grappling with this for a long time and would really appreciate any help. Many, many hours have been spent trawling help, books this forum and others but to no avail yet.
I will use the fictitious example of Acme distilleries to illustrate the problem. To anyone who may want to help but is offended by the alcohol reference, sorry, and please be assured that the real world application for this has nothing to do with making alcohol.
Let's say Acme wants to know the average age of it's total stock of wine/whiskey/moonshine that is ageing in barrels. Each year some will be removed from barrels (always the oldest) and new stock will be introduced. When the distillery is expanding, new barrels are purchased. After a point the distillery is at peak capacity and any new stock is only put into barrels from which that year's 'harvest' is taken out.
The key figure is the average age of the overall volume of liquid in barrels.
The amount being taken out will not be limited to a certain age. EG in one year more than the oldest 1 year's worth of liquid can be removed.
I'm looking for a non VBA solution to this:
I need a function that will look at the amount being removed from barrels (the oldest stock) and subtract this from the total stock.
Then I need the change in volume of stock per year to reflect this in the calculation of the average age of all remaining stock including the addition of the new liquids for that year.
The attached document shows my progress. I'm close, but may be overlooking something obvious/more eloquent. Please take a look and let me know your thoughts.
Thanks very much!