How to calculate ending inventory: the basic formula every business should know

How to calculate ending inventory: the basic formula every business should know
If you run a business that holds merchandise —a shop, a store, a warehouse, a grocery—, sooner or later you need to know how much stock you have left. Not what you think is left, but a figure with a method behind it. That number has a technical name: ending inventory. It is the value of the goods you hold when a period closes, and knowing how to calculate it properly changes the way you buy, sell and make decisions.
The good news is that you do not need an accounting degree to understand it. Ending inventory is worked out with a simple formula built on three figures that your own business already produces every day: what you had at the start, what you bought, and what you sold at cost. In this article we break it down piece by piece, test it with a complete worked example and explain why the result is theoretical until you compare it with a real physical count.
The basic ending inventory formula
It all comes down to a single line:
Ending inventory = beginning inventory + purchases for the period − cost of goods sold
Read it from left to right and it tells the story of your merchandise over a period: you start with a balance (beginning inventory), add the goods that come in (purchases at cost) and subtract what goes out the door sold (cost of goods sold). What remains is, in theory, what should be sitting on your shelves at the end of the period.
It is the same logic you use with your wallet: if you started the month with 100, received 50 and spent 40, you are left with 110. Inventory works the same way, except the figures represent goods valued at cost, not cash.
One important detail: the formula works with costs, not selling prices. When you sell a product, you do not subtract what the customer paid you, but what it cost you to acquire it. That is why the term being subtracted is cost of goods sold, and not plain sales.
What each term means, in plain words
Before using the formula, it pays to be clear on the three ingredients, because a mistake in any of them contaminates the whole result. Let us go through them one by one.
Beginning inventory
This is the value of the merchandise you had on the first day of the period. If you work by months, it is what remained at the close of the previous month. Ideally it comes from the adjusted physical count of the past period or from your stock records. It is not a number from memory: it is the starting point, and it must be verified, because everything else is built on top of it. A mistake here carries through the entire calculation, so it is always worth double-checking.
Purchases for the period (at cost)
These are all the merchandise entries during the month: supplier invoices, restocks, cash and credit purchases. They are recorded at acquisition cost — what you actually paid for the goods before any margin. If you bought 50 units of a product at 2 each, your purchases for the period add up to 100. If you want a more realistic cost, add the direct expenses of getting the goods into your store, such as freight. What matters most is discipline: every entry must be recorded, because the formula only counts what appears on paper.
Cost of goods sold
This is the cost value of everything you sold in the period. If you sold 30 units of that same product, your cost of goods sold is 30 × 2 = 60. This is the piece people mix up most often: many subtract the cash that came in from sales, and that is a mistake. The formula needs how much what you sold cost you, not how much you charged. The difference between the two is precisely your margin — and margin cannot be part of the value of your stock. If you do not have the cost of each sale at hand, this calculation becomes a tangle; that is why it is wise to record exits at cost from the very beginning.
A complete worked example: a store in one month
Let us put numbers on the table with a concrete case. A grocery store wants to know its ending inventory for March. Its data for the month:
- On March 1 it held merchandise valued at 8,000 (beginning inventory).
- During March it bought 12,500 worth of goods from suppliers (purchases at cost).
- The cost of the merchandise it sold in March was 11,300 (cost of goods sold).
With that data, the formula works out like this:
| Item | Value |
|---|---|
| Beginning inventory (March 1) | 8,000 |
| (+) Purchases for the month at cost | 12,500 |
| (=) Goods available for sale | 20,500 |
| (−) Cost of goods sold | 11,300 |
| (=) Theoretical ending inventory (March 31) | 9,200 |
According to the formula, at the end of March the store should hold merchandise worth 9,200. Goods available for sale —20,500— is a useful intermediate concept: it represents everything the store could have sold during the month, and from it you only need to subtract what actually went out.
Why the result is theoretical: comparing with the physical count
Here comes the part many business owners learn the hard way: the 9,200 almost never matches what is really on the shelves. The formula is arithmetically correct, but it assumes that everything you bought either arrived, was sold or is still there. Reality is noisier. There may be shrinkage —expired, broken, spilled or spoiled goods—, internal or external theft, customer returns that were never put back into stock, recording errors, miscounted merchandise or invoices that do not match what was received.
That is why the result of the formula is called theoretical ending inventory: it is what should exist if the world were perfect. The truth is told by the physical count, which means counting, unit by unit, what you actually hold at the close. Comparing the two is one of the most valuable exercises in the business:
| Item | Value |
|---|---|
| Theoretical ending inventory (per formula) | 9,200 |
| Actual ending inventory (physical count) | 8,650 |
| Difference (period shortage) | 550 |
In this case, 550 in merchandise is missing. That difference is adjusted against inventory and recorded as a loss for the period. It hurts, but it is valuable information: 550 against a movement of more than 20,000 is a shortage of about 2.7%, and if it repeats month after month it is telling you there is a specific problem —expiry control, security, receiving processes or discipline in record-keeping— worth attacking. A business that never compares the formula with the physical count does not know how much it is losing, and not knowing is the first loss.
When to calculate ending inventory
The frequency depends on what you are going to do with the figure. For day-to-day management, the practical choice is every month: it tells you whether your purchases are keeping pace with your sales, whether you are piling up slow-moving goods and whether shortages show up systematically. Catching them early lets you correct before the problem grows, and comparing month against month shows you the real trend of your operation.
For the accounting and tax close, on the other hand, ending inventory is determined at least once a year, almost always backed by a full physical count. That value feeds the income statement —because it defines the real cost of goods sold for the year— and the balance sheet, where inventory appears as a current asset. Many businesses combine both rhythms: full annual physical counts and monthly calculations for management, with cycle counts of the most valuable or most shortage-prone categories in between.
The difference from beginning inventory and from the perpetual system
It is worth not confusing ending inventory with two neighbouring concepts. Beginning inventory shares the same nature —both are the value of stock on a given date— and they differ only in the date: beginning inventory opens the period and ending inventory closes it. In fact, the ending inventory of March is, by definition, the beginning inventory of April. They are two views of the same figure.
The costlier confusion is with the perpetual inventory system, the one kept through a kardex or stock card. In the periodic system —the one of the formula we just used—, inventory is calculated at the end of the period by subtracting what was sold from what was available. In the perpetual system, by contrast, every movement updates the balance instantly: when goods come in, the record adds; when goods are sold, the record subtracts the cost of goods sold. The kardex balance tells you at any moment how much you should have, with no need to wait for the end of the month or to do manual adding.
That does not eliminate the physical count: even with a flawless kardex, comparing it with the count is still necessary to detect shrinkage and theft. The difference is that the kardex does the work of the formula automatically and permanently, movement by movement, instead of depending on a manual end-of-month calculation. Tools like Kardex Tauro are designed precisely for that: keeping your stock balance up to date with every entry and exit, and delivering the value of ending inventory when you need it, without spreadsheets or manual adding.
How to use the figure to decide your purchases
Ending inventory is not a number to file away: it is the starting point for your next purchases. The logic is simple. If your ending inventory for March was 9,200 and in April you expect to sell about 12,000 at cost, you do not need to buy 12,000: you use what you already have first. The month's purchases should cover the difference between what you will sell and what you have left, plus a safety cushion so you do not run out of stock.
In numbers: 12,000 of projected sales at cost minus 9,200 of ending inventory equals 2,800 of minimum purchases, plus the safety margin you choose based on how reliable your suppliers are and how fast your merchandise moves. If you buy without looking at ending inventory, you run two opposite risks: overbuying —cash sitting still on shelves, products expiring, space occupied— or running short —lost sales from stockouts. Ending inventory gives you the starting point so you do not have to guess.
It is also useful for spotting trends. If ending inventory climbs month after month while sales stay flat, you are piling up merchandise that is not turning; if it falls faster than your sales, you may be losing more than you think to shortages. In both cases the figure stops being an accounting formality and becomes a decision tool. The formula is basic, but businesses that apply it with discipline —calculating, counting and comparing— are rarely surprised by numbers at the end of the year. And when the calculation rests on a good kardex system such as Kardex Tauro, what you are left with is time to sell, not time to add figures.