Closing Stock Formula: Two Ways to Calculate It, With a Worked Example
Closing stock = opening stock + purchases − cost of goods sold. That is the book figure; the counted figure is quantity × cost. Both routes on one worked shop quarter, the gross profit method, and what the £740 gap between them means.
In this article15 sections
The closing stock formula is: closing stock = opening stock + purchases − cost of goods sold. It gives the value of the goods you should still hold at the end of a period. The figure that goes into year-end accounts is normally found another way: count what is on the shelf and multiply each quantity by its unit cost.
Those are two routes to one number, and they rarely agree. Textbooks show the formula with tidy figures and stop there. This article runs both routes on the same shop quarter, shows why the answers differ by £740, and explains which one to use when.
The closing stock formula, term by term#
Closing stock = opening stock + purchases − cost of goods sold
- Opening stock is the value of goods held at the start of the period. It is the closing stock of the period before, unchanged.
- Purchases are the goods bought for resale during the period, at cost. Costs of getting them to you, such as freight and duty, are usually included.
- Cost of goods sold is what the goods you sold cost you. It is not what you sold them for.
Opening stock plus purchases is everything you had available to sell. Whatever was not sold must still be there. All three figures are at cost and exclude recoverable sales tax. The formula can also be run in units for a single product: 40 in stock, 60 received, 75 sold, so 25 should remain.
Closing stock, closing inventory, ending inventory#
The three names mean the same thing. “Closing stock” is the usual term in the UK, Ireland, India and Australia. “Ending inventory” and “closing inventory” are the usual terms in the United States, where the closing inventory formula is written as beginning inventory + purchases − cost of goods sold. The arithmetic is identical.
The same relationship is more often seen turned round, with cost of goods sold as the answer: opening stock + purchases − closing stock. That version is the one in a set of accounts, and it explains why closing stock matters so much. It is the only one of the three inputs that cannot be read from an invoice.
Two routes to the same figure#
The formula needs cost of goods sold as an input. A shop gets that in one of two ways. Either its system records the cost of every item as it is sold, or it estimates the cost from sales and its usual margin. Both give a book figure: what the records say should be left.
The second route ignores the records and looks at the shelf. Count every product, multiply each quantity by its unit cost and add the lines up. That is a counted figure: what is really left.
Which of these you can rely on depends on whether your stock records are kept continuously or only brought up to date at a count, the distinction drawn in perpetual vs periodic inventory.

The worked quarter: a homeware shop, July to September#
One shop, one quarter, figures at cost and excluding VAT.
| Input | Amount | Where it comes from |
|---|---|---|
| Opening stock, 1 July | £18,400 | The count at 30 June |
| Purchases, July to September | £27,300 | Supplier invoices for goods received |
| Sales, July to September | £52,000 | Order reports, net of refunds |
| Usual gross margin | 42% | Last year’s accounts |
Goods available for sale are £18,400 + £27,300 = £45,700. Every pound of that is either sold or still in the building, or has been lost. The two routes divide the £45,700 differently.
Route one: how to calculate closing stock from the formula#
If your system records a cost for each item sold, add those costs up for the quarter. Suppose that total is £30,160. Then:
Closing stock = £18,400 + £27,300 − £30,160 = £15,540
That takes a minute, and it can be done at any month end without touching a shelf. Its weakness is in what it assumes. It assumes every unit that left the building was sold. A mug that was broken, stolen or sent out as a replacement has no sale and so no cost of goods sold. The formula still counts it as stock.
It also assumes every recorded cost was right, and that purchases and sales were recorded in the correct period. Each of those is a place for the figure to drift from the shelf.
The gross profit method: closing stock with a margin instead of costs#
Many small shops do not record a cost per sale. They can still estimate cost of goods sold from sales, using their usual gross margin. This is called the gross profit method.
Estimated cost of goods sold = sales × (1 − gross margin)
With a 42% margin, cost is 58% of sales: £52,000 × 0.58 = £30,160. Put that into the formula and closing stock is again £15,540. In this example the two book figures match because the shop’s recorded costs happen to equal 58% of its sales.
The method is used for monthly management figures and for estimating stock lost in a fire or flood, when there is nothing left to count. Use gross margin, which is a share of the selling price, and not markup, which is a share of cost. The two are different numbers, as margin vs markup explains.
Route two: counted quantity times unit cost#
At close of business on 30 September the shop counts everything and values each line at cost.
| Category | Units counted | Average unit cost | Value |
|---|---|---|---|
| Ceramics | 620 | £9.50 | £5,890 |
| Textiles | 410 | £12.00 | £4,920 |
| Candles | 900 | £3.20 | £2,880 |
| Kitchenware | 150 | £7.40 | £1,110 |
| Total | 2,080 | £14,800 |
In practice the sum is done line by line, product by product, and the category rows are subtotals. Counted closing stock is £14,800.
This figure assumes nothing about what happened during the quarter. It only needs the count to be complete and the unit costs to be right. That is why accountants prefer it for year-end accounts. How to run and file that count is covered in year-end inventory count in WooCommerce.
Why the two figures differ: the £740#
| Route | Closing stock |
|---|---|
| Formula (book) | £15,540 |
| Count × cost | £14,800 |
| Difference | £740 |
The books expected £740 more stock than the count found. That gap is the quarter’s unexplained loss, and it has five possible sources:
- Shrinkage. Goods broken, stolen, given away or sent as replacements without a record.
- Margin drift. Discounts or a shift towards lower-margin products mean the true cost of sales was above 58%.
- Cutoff. A delivery invoiced in September but received in October, or the reverse.
- Cost errors. A unit cost that was typed wrongly, or never updated after a price rise.
- Count errors. A shelf missed, or a box of twelve counted as one.
Measured against sales, £740 is 1.42% of £52,000. Measured against book stock it is 4.76% of £15,540. The inventory shrinkage calculator does both sums from your own figures.
How sensitive the estimate is to the margin#
Before calling the whole £740 shrinkage, test the margin. The gross profit method multiplies sales by a percentage, so a small error in the percentage becomes a large error in pounds.
| Assumed margin | Estimated cost of goods sold | Closing stock estimate | Gap to the count |
|---|---|---|---|
| 43% | £29,640 | £16,060 | £1,260 |
| 42% | £30,160 | £15,540 | £740 |
| 41% | £30,680 | £15,020 | £220 |
Each point of margin moves the estimate by 1% of sales, here £520. A shop that ran a summer sale and really earned 41% would see most of its “shrinkage” disappear. Run the other way, the count gives the true margin: cost of goods sold was £18,400 + £27,300 − £14,800 = £30,900, gross profit was £52,000 − £30,900 = £21,100, and £21,100 ÷ £52,000 is 40.6%.
So the estimate is only as good as the margin behind it, and the count is what tells you the margin.
Closing stock valuation: which unit cost to use#
The count gives quantities. The value depends on the cost you attach to each unit, and identical items bought at different prices can be costed in more than one way.
- First in, first out assumes the oldest units were sold first, so closing stock is valued at the most recent purchase prices.
- Weighted average cost values every unit at the average of what was paid.
- Specific identification uses each item’s own cost, for one-off goods such as antiques.
Under IAS 2, the international standard, stock is measured at the lower of cost and net realisable value, and interchangeable goods are costed by first in, first out or weighted average. The United States also allows last in, first out. The methods are compared in FIFO vs LIFO and weighted average cost.
“Lower of cost and net realisable value” means a line you can only sell below cost is valued at what it will fetch. Rules differ between countries and between accounting frameworks, so confirm the method with your accountant and keep to it from year to year.
What a wrong closing stock does to profit#
Closing stock is subtracted when cost of goods sold is worked out, so every pound of error passes straight into profit.
Suppose the shop skipped the count and used the book figure of £15,540. Cost of goods sold would be £30,160 and gross profit £21,840. The true figures are £30,900 and £21,100. Profit for the quarter is overstated by £740, and tax may be paid on profit that was never made.
The error does not stay put. September’s closing stock is October’s opening stock. An opening figure £740 too high makes the next period’s cost of goods sold £740 too high, so that period’s profit is understated by the same amount once a real count is done. Over the two periods the total is right. Each period on its own is wrong.
Which route to use when#
| Situation | Use | Why |
|---|---|---|
| Year-end accounts | Count × cost | Assumes nothing; shows the loss |
| Monthly or quarterly management figures | Formula | Fast; good enough between counts |
| Stock destroyed or stolen in bulk | Gross profit method | Nothing left to count |
| Checking a count that looks wrong | Both | A large gap points at a missed area |
| Measuring shrinkage | Both | Shrinkage is the difference |
A simple rule covers most shops: estimate monthly, count at least once a year, and investigate whenever the two differ by more than 2% of the period’s sales. In the worked quarter the gap was 1.42%, inside that limit, though still worth a look at the margin. What your tax authority accepts for a year end is a question for your accountant.
Getting the numbers out of WooCommerce#
WooCommerce can supply part of each route.
For the counted route, Products → All Products → Export produces a CSV with a Stock column for every product and variation. If WooCommerce’s Cost of Goods Sold feature is switched on, the export also has a “Cost of goods” column, so quantity × cost can be added up in a spreadsheet. The field and its limits are described in WooCommerce cost of goods.
Three cautions apply. The Stock column is what WooCommerce believes, not what was counted, so it gives a book figure until you have counted and corrected it. It is the quantity at the moment of export, and WooCommerce does not store what the quantity was on an earlier date, so export at close of business on the last day. And WooCommerce reduces stock when an order is paid, not when it is dispatched, so parcels waiting to go are already out of the number.
Purchases are not in WooCommerce at all. That input comes from your supplier invoices or bookkeeping. Wider options are covered in inventory valuation in WooCommerce.
Counting for the closing stock figure with Stocktake#
Stocktake is a free stock counting plugin for WooCommerce, available on WordPress.org. It does not calculate closing stock with the formula and it does not keep your purchases. It supplies the counted quantities for route two, and it shows the gap between book and count line by line.
A full count session lists every stock-managed product and variation. You count by scanner, phone camera (Beta) or typed entry. For each line the review shows the expected quantity, the counted quantity and the difference, in units and, when WooCommerce Cost of Goods data is set, in money. Check the unit values before relying on the total: where no cost is recorded, the report falls back to the regular selling price.

One click applies the count to WooCommerce stock, with an automatic backup and an undo. The count and its variance export as CSV in the free version; the value of everything on hand is then quantity × cost in your spreadsheet. Stocktake Pro adds an inventory valuation report at retail and at cost with a per-category breakdown, and Excel and PDF exports.
Closing stock formula: frequently asked questions#
What is the formula for closing stock?
Closing stock equals opening stock plus purchases minus cost of goods sold, with every figure at cost. For example, opening stock of £18,400 plus purchases of £27,300 less cost of goods sold of £30,160 gives closing stock of £15,540. The result is a book figure: what the records say should be left on the shelves.
How do you calculate closing stock without cost of goods sold?
Estimate cost of goods sold from sales with the gross profit method. Multiply sales by one minus your usual gross margin: with sales of £52,000 and a 42% margin, cost is £30,160. Then use the normal formula. The answer is only as reliable as the margin, and one point of margin moves it by 1% of sales.
Is closing stock the same as ending inventory?
Yes. Closing stock, closing inventory and ending inventory all mean the value of goods held for sale at the end of an accounting period. Closing stock is the common term in the UK and countries that follow its usage; ending inventory is the common term in the United States. The formula and the treatment are the same.
Why does counted closing stock differ from the formula?
The formula assumes every unit that left was sold and every cost was recorded correctly. A count shows what is really there. The difference is made up of shrinkage such as breakage and theft, margins that were lower than assumed, purchases or sales recorded in the wrong period, wrong unit costs and mistakes in the count itself.
Where does closing stock go in the accounts?
It appears twice. In the profit calculation it is subtracted from opening stock plus purchases to give cost of goods sold, so a higher closing stock means a higher profit. On the balance sheet it is shown as a current asset. It then becomes the opening stock of the next period. Presentation rules vary by country, so check with your accountant.
How often should closing stock be counted?
At least once a year for the year-end accounts, and whenever the estimate and reality seem to have drifted apart. Between counts, the formula gives a usable monthly figure. Shops with high-value or easily lost goods often count part of the stock every week so that the annual count holds few surprises.
