Averaging Liquid Inventory Price on a 1st in 1st out basis

BStern

New Member
Joined
Nov 15, 2016
Messages
3
I am trying to build a spreadsheet that would average the inventory that we currently have stored. As our inventory is constantly changing, I need to know at any given time the cost of what is in inventory based on a percentage (liquid). Ideally I would like to enter a percentage of what we have in a tank, and get the average price of that based on loads that have come in to fill it... however, the first load that comes in to fill the tank needs to be the first load that leaves...

example: 500 gallons come in at $1.00, 500 gallons come in at $.80, 500 gallons come in at $.50 But we only have 700 gallons in our inventory, I would need to average the last load of 500 gallons at $.50 and a partial amount of the second load 200 gallons.

So if there was some way enter the percentage of what the tank actually has in it and a formula that could compute the true average cost of it, I would be thrilled!

ANY HELP is APPRECIATED! :)
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Welcome to the forum.

A single-cell solution might be too ambitious. It might be possible, but it would be very complicated. Instead, I created a helper column that should work for you.

ABCDEFG
1Purchase amount Purchase cost HelperAmount in tankAverage cost
2500 $ 1.00 0700 $ 0.59
3500 $ 0.80 200
4500 $ 0.50 500

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet16



C2: =IF(A2="","",IF(C3="",MIN(A2,E2),MAX(0,MIN($E$2-SUM($C3:$C$100),A2))))
G2: =SUMPRODUCT(B2:B100,C2:C100)/E2

Layout the sheet as shown. Put the formula in C2 and copy down as far as needed. I assumed a bottom row of 100, but you can change that. Then put in the purchase amounts in columns A:B as shown, and the amount in the tank in E2 as shown. The formula will figure out how much of the amount in the tank is due to the latest purchase, and the formula in G2 figures the weighted average.

Let me know if this helps.
 
  • Like
Reactions: shg
Upvote 0
Thank you so much, however, I tried it out, and I am going to be entering the loads continually and I set up a scenario where I put 2 loads in at 10000 gallons each, the 1st at $3.00 and 2nd at $2.00. I put 20000 gallons as the amount in the tank and the average price came to be $1.00.... :/
 
Upvote 0
Can you show me what your sheet looks like? This is what I see when I try that scenario:

ABCDEFG
1Purchase amount Purchase cost HelperAmount in tankAverage cost
2500 $ 1.00 020000 $ 2.50
3500 $ 0.80 0
4500 $ 0.50 0
510000 $ 3.00 10000
610000 $ 2.00 10000

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet16
 
Upvote 0
I got it to work. :) Thank you so much for you help! One more question... this workbook will be split by months (1 month per sheet), is there anyway to bridge the months so that if we have inventory we are still holding from November, but we are in December, it will pull from the November sheet?
 
Upvote 0
I just noticed an issue with my formula, the first E2 should be $E$2.

As far as your latest question, let's say at the end of November you have 700 gallons left with an average cost of $1.25. On the first row on the December sheet, put a dummy purchase of 700 gallons with a cost of $1.25. Then add purchases below that as normal. That should calculate the average for you using the November surplus.

Hope this helps! :)
 
Upvote 0

Forum statistics

Threads
1,214,608
Messages
6,120,500
Members
448,968
Latest member
screechyboy79

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top