Spark Inventory
Free inventory tool

Ending inventory formulaand calculator, with COGS and average inventory

Ending inventory, beginning inventory and cost of goods sold all come from one equation. Enter any three figures to get the fourth, plus average inventory and turnover.

Calculate

The starting numbers are example values, not Spark data. Replace them with your own, all at cost for the same period.

Ending inventory

$35,000

Goods available for sale

$65,000

Average inventory

$37,500

Inventory turnover

0.8×

Cost of goods sold

$30,000

Ending inventory = beginning inventory + purchases − COGS. Average inventory = (beginning + ending) ÷ 2.

The formulas

How to calculate ending inventory

Everything you had to sell in a period either sold or is still on the shelf. Write that down and each formula falls out of it.

Beginning inventory + purchases = COGS + ending inventory

Ending inventory = beginning + purchases − COGS
Beginning inventory = ending + COGS − purchases
COGS = beginning + purchases − ending
Average inventory = (beginning + ending) ÷ 2

Use cost, not selling price, for every figure, and the same costing method throughout. See FIFO vs LIFO for how the method changes the numbers, and the inventory turnover calculator for days in inventory.

Worked example (illustrative numbers)

  1. 1. Goods available. The quarter starts with $40,000 of stock at cost and $25,000 is bought: $65,000 available to sell.
  2. 2. Ending inventory. Goods costing $30,000 sell: 40,000 + 25,000 − 30,000 = $35,000 should be left.
  3. 3. Check it with a count. The count finds $33,800. The $1,200 gap is shrinkage, and COGS for the books becomes $31,200.
  4. 4. Average inventory. (40,000 + 33,800) ÷ 2 = $36,900, which turnover is measured against.

The formula says what should be there; only a count says what is. Run both, and track the gap.

Skip the period-end math

Know your inventory value every day, not once a quarter

The formula is only needed when stock is not tracked as it moves. Spark Inventory keeps the running numbers for you.

Stock valued at cost

Spark keeps stock on hand for every SKU and warehouse as orders, receipts, transfers and adjustments happen, and values it from cost layers.

Counts that explain the gap

Count on the web or by scanning on the mobile app. Each adjustment is recorded with who made it and why, so shrinkage can be traced.

COGS from real sales

Sales orders and receipts carry their costs, so cost of goods sold comes from what actually shipped instead of a year-end plug.

Plan the next period

Demand ESP forecasts each SKU, so you can see what ending inventory will look like before you place the next order.

Ending inventory FAQ

Ending inventory, COGS and average inventory questions

Tracking stock in a spreadsheet? Start from the free inventory template, which includes a count sheet.

What is the ending inventory formula?+

Ending inventory = beginning inventory + purchases − cost of goods sold, all at cost for the same period. If you started the quarter with $40,000 of stock, bought $25,000 and sold goods that cost $30,000, ending inventory is 40,000 + 25,000 − 30,000 = $35,000.

How do you calculate ending inventory?+

Either count it or work it out. Counting means a physical count of every item multiplied by its unit cost. Working it out uses the formula: beginning inventory plus purchases minus cost of goods sold. Doing both and comparing them shows your shrinkage: stock that was lost, damaged or never recorded.

How do you calculate beginning inventory?+

Beginning inventory is last period’s ending inventory. If you only have this period’s figures, rearrange the formula: beginning inventory = ending inventory + cost of goods sold − purchases.

What is the cost of goods sold formula?+

COGS = beginning inventory + purchases − ending inventory. It is the cost of the stock that left the business through sales in the period. Include freight in on purchases, and use the same costing method (FIFO, LIFO or weighted average) for both inventory figures.

How do you calculate average inventory?+

Average inventory = (beginning inventory + ending inventory) ÷ 2. For a smoother figure over a year, add up each month’s ending inventory plus the opening balance and divide by 13. Average inventory is what inventory turnover and days in inventory are measured against.

Does FIFO or LIFO change ending inventory?+

Yes, when costs change. FIFO assumes the oldest units sell first, so ending inventory is valued at the newest, usually higher, costs. LIFO assumes the newest sell first, so ending inventory carries older costs. The formula is the same; only the cost per unit differs. LIFO is not allowed under IFRS.

Should I use units or dollars?+

The formula works in either. Accounting uses dollars at cost. For a single item, units are often more useful: units on hand at the start plus units received minus units sold tells you what should be on the shelf, which you can check against a count.

How does Spark Inventory track ending inventory?+

Spark keeps stock on hand by SKU and warehouse as orders, receipts, transfers and adjustments happen, and values it at cost from its cost layers, so the current inventory value is always one question away. Counts and adjustments are recorded with who made them, so a gap between expected and counted stock can be traced.

Free for one user

See your stock and what to reorder, every day

Connect your sales history and Demand ESP forecasts every SKU and turns it into monthly reorder recommendations.

  • Free: per-SKU Demand ESP forecasts and seasonal curves
  • Free: stock-risk reports and monthly reorder recommendations
  • Solo ($99/mo): continuous forecasts, live alerts and Text with Sparki