COGS
Same oil, two prices: your cost is the average.
Twelve pounds left at $4.20 and a new pail at $5.25: your next batch costs its oil at $4.98 a pound, the average of what is on the shelf. Here is the sum.
The short answer
- Your cost is the average of what is on the shelf, weighted by quantity: 12 lb at $4.20 and 35 lb at $5.25 is $4.98 a pound, not the midpoint.
- It costs every batch from now on. Batches already made keep their cost.
- Recompute it on every purchase. Rounding up belongs in the price, not the cost.
You have 12 lb of olive oil left from a pail you bought at $4.20 a pound. The new pail arrives: 35 lb at $5.25. Which price goes into the next batch? Neither. The oil on your shelf cost you $234.15 for 47 lb, which is $4.98 a pound, and that is what the next batch is costed at. The method is called a weighted average, and it is the one costing rule that never needs you to know which pail a scoop came from.
Which price is your cost when the same oil sits at two prices?
The weighted average of everything on the shelf: what the old oil cost plus what the new oil cost, divided by how much oil there is now.
12 lb × $4.20 = $50.40
35 lb × $5.25 = $183.75
47 lb $234.15
$234.15 ÷ 47 lb = $4.98 a pound
Weighted means the pail with more oil in it pulls harder. There is nearly three times as much oil at $5.25 as at $4.20, so the average lands close to $5.25. The midpoint, $4.725, is the number people reach for first, and it is wrong for exactly that reason: it treats 12 lb and 35 lb as equals.
The old price is wrong because 35 of the 47 lb cost more than that. The new price is wrong because 12 lb cost less. The average is the only figure that ties out: cost per pound, times the pounds on the shelf, comes back to what you paid. Multiply $4.98 by 47 lb and you get $234.06, nine cents short of $234.15. Those nine cents are the rounding to the cent, which is why costing software keeps a few more decimals inside and rounds only when it shows you the number. By hand, carry $4.9819 into the next step and round at the end.
What does that do to your cost per bar?
Eight cents a bar, on this recipe. The batch uses 4 lb of olive oil and cuts into 40 bars, so each bar carries a tenth of a pound. Here is that line at all three prices.
If nothing else in the recipe moved, the whole bar's cost moved by those eight cents. The maker who kept costing at $4.20 is under by eight cents a bar on every batch until the pail runs out. The maker who jumped straight to $5.25 is over by three cents, which is smaller, but still a number that ties out to nothing they paid.
On rounding: round half away from zero, so $0.525 becomes $0.53, and round at the last step. A
per-bar figure rounded early and multiplied back across forty bars is how a batch cost drifts a
dollar from the invoice.
What happens to the average on the next pail?
It moves again, toward the price you are actually paying. Say you make eight batches from the mixed shelf: 32 lb used, 15 lb left, all of it costed at $4.98, because the average is one number for the whole pail. Then the third pail arrives, 35 lb at $5.25 again.
15 lb × $4.98 = $74.70
35 lb × $5.25 = $183.75
50 lb $258.45
$258.45 ÷ 50 lb = $5.169
rounds to $5.17 a pound
The olive oil line is now 4 × $5.17 = $20.68 a batch and $20.68 ÷ 40 = $0.517, which rounds to
$0.52 a bar. The $4.20 oil is nearly gone from the number the way it is nearly gone from the shelf.
After one more pail at $5.25 the average will be within a few cents of $5.25, and once the old
oil is used up entirely it will sit there until the supplier moves again.
This is why it is called a moving average. Each purchase nudges the figure once, and you never re-cost from scratch. The only thing you need when a pail arrives is how much is left of the last one.
What about the batches you already made?
They keep the cost they were made at. The eight batches you made from the mixed shelf carry olive oil at $0.50 a bar for as long as those bars exist, and the batches from before the price rise stay at $0.42. The new average is a fact about the shelf today. It changes nothing behind it.
If September's price rise reached back into July's batches, your margin on July's sales would shrink in September, and nothing about July changed. The rule is to write the unit cost onto the batch when you make it and onto the order line when it ships, and to read that stored figure whenever you look back, which is the same rule that decides what a customer return does to your COGS: the cost that comes back is the cost that went out, not today's.
Should you just use the higher price to be safe?
Not as your cost. The advice you will find on every maker forum, to always pad and round up, is pricing advice, and it is fine as pricing advice. It goes wrong the moment it is written into the cost column. If you record $5.25 a pound when the oil on your shelf averaged $4.98, you have hidden 27 cents a pound of margin from yourself, and you can no longer tell a product that is genuinely thin from one that only looks thin because you were being careful.
Keep the cost at what you paid. Put the caution in the price, where you can see it and decide about it. A 10% cushion on the price is a choice you can defend. A cost written 27 cents above what you paid is just a wrong number.
There is one place the newest price does matter, and it is a pricing question, not a costing one. If you are setting a wholesale sheet that has to hold until spring, the 15 lb of cheaper oil will be gone long before then and every batch will be at $5.25. Set that price from $5.25. Read today's margin from $4.98. They answer different questions, and the mistake is using one number for both.
Why not track each pail separately, or use the old oil first?
You can, and sometimes it is literally what happens: you finish one pail before you open the next, and each batch is costed at the pail it came from. Accountants call that specific identification, or first-in first-out when the oldest stock always goes first, and for a material you can tell apart, like jars from two orders in two boxes, it works. It stops working the first time a batch draws from both pails, and for oils that is most batches. Sellers who try to keep the layers separate end up entering each shipment as its own item, so the material list doubles and the recipe cannot tell which one a batch used. The average collapses the pails into one quantity and one cost, without pretending to know which drop of oil went into which bar.
This is the cost you price from and measure margin against. How inventory is valued on a tax return is a separate question for your accountant. For US filers, the IRS has since 2008 accepted a rolling average that is recomputed on every purchase, or at least once a month, under conditions set out in Rev. Proc. 2008-43 (checked 2026-09-20). Ask them whether your return uses it.
How do you keep the average current?
Three habits, and the first is the one that fails.
- Know how much is left. The formula needs the quantity on hand at the moment the new pail arrives, and you only know it if every batch took its recipe quantity off the shelf when you made it. If you have not been doing that, weigh the old pail before you pour the new one in, subtract the container, and start from there.
- Use the price the oil actually cost to get here. If the $183.75 pail arrived with $18 of shipping on the order, the pail's price for this sum is its share of that, not the invoice line. Shipping on supplies is part of the material cost, and that post shows how to split one charge across an order.
- Recompute on every purchase, not at year end. One sum per delivery is a minute. Reconstructing a year of deliveries in January is a weekend, and it is usually done wrong.
By hand, the cost of the method is the third habit: every recipe that uses olive oil has to be re-costed each time the average moves, and a maker with thirty recipes stops doing it by March. That is the part worth handing to software. In Trackost, a production run takes each material's recipe quantity off the shelf, a purchase receipt runs this exact sum on what is left, and every recipe that uses the material shows its new per-unit cost.
Questions
Every time I restock, the price is different. Do I have to re-cost every product?
Every product that uses that material, yes, but only that one line of it. Recompute the material's average once, then carry the new figure into each recipe that uses it. Software that keeps recipes linked to materials does that pass for you.
Should I enter each shipment as a separate item so I can track its own cost?
No. Splitting one oil into an old-price item and a new-price item doubles your material list, and a recipe cannot tell which one a batch used. Keep one material with one average cost and one quantity on hand, and let each purchase move the average.
I buy the same oil from two suppliers at different prices. Is it the same rule?
Yes. If it is the same material going into the same recipe line, where it came from does not matter to the cost. Average the two purchases by quantity exactly as you would two pails from one supplier.
What if I do not know how much of the old oil is left?
Weigh it before you pour the new pail in, and subtract the weight of the empty container. From then on, take each batch's recipe quantity off the shelf as you make it, so the next time a pail arrives the number is already waiting.