Skip to content

COGS Formula and Inventory Method Examples

By Newtown Analytics · · 7 min read

For smb owners & operators

The COGS formula is simple, and the number it gives depends on how you assign cost to the units sold. When the price you pay for stock changes through the year, the choice of inventory method decides which cost goes into cost of goods sold and which stays on the balance sheet. The same purchases and sales can give three different profit figures, all of them legitimate under the right rules. This guide shows the formula, works through first-in first-out, last-in first-out and weighted average with the same set of purchases and checked arithmetic, explains perpetual and periodic systems, covers write-downs and standard costing, and suggests how to choose a method. It belongs to unit economics and budgeting and forecasting, builds on cost of goods sold and retail margin structures, and uses the cost build-up from landed cost.

The formula again

COGS = Beginning inventory + Purchases - Ending inventory

The only question is how to value the ending inventory, which is the same as asking which units were sold. If every unit cost the same, the answer would be unique. When costs change, the method matters.

One set of purchases, three methods

A company starts the quarter with no inventory and buys three lots of one product:

MonthUnits boughtCost per unitCost of the lot
January100$10$1,000
February100$12$1,200
March100$14$1,400
Total300$3,600

During the quarter it sells 150 units at $25 each, for revenue of 150 × 25 = $3,750. Ending inventory is 150 units.

First-in, first-out (FIFO)

FIFO assumes the oldest units are sold first. The 150 units sold come from January (100 units) and February (50 units).

  • COGS = 100 × $10 + 50 × $12 = 1,000 + 600 = $1,600
  • Ending inventory = 50 × $12 + 100 × $14 = 600 + 1,400 = $2,000
  • Check: 1,600 + 2,000 = 3,600 ✓
  • Gross profit = 3,750 - 1,600 = $2,150

Last-in, first-out (LIFO)

LIFO assumes the newest units are sold first. The 150 units come from March (100) and February (50).

  • COGS = 100 × $14 + 50 × $12 = 1,400 + 600 = $2,000
  • Ending inventory = 100 × $10 + 50 × $12 = 1,000 + 600 = $1,600
  • Check: 2,000 + 1,600 = 3,600 ✓
  • Gross profit = 3,750 - 2,000 = $1,750

Weighted average cost

The weighted average method uses the average cost of all units available: 3,600 / 300 = $12.00 per unit.

  • COGS = 150 × $12 = $1,800
  • Ending inventory = 150 × $12 = $1,800
  • Check: 1,800 + 1,800 = 3,600 ✓
  • Gross profit = 3,750 - 1,800 = $1,950

Summary

MethodCOGSEnding inventoryGross profitGross margin
FIFO$1,600$2,000$2,15057.3%
LIFO$2,000$1,600$1,75046.7%
Weighted average$1,800$1,800$1,95052.0%

Check the margins: 2,150 / 3,750 = 57.3 percent; 1,750 / 3,750 = 46.7 percent; 1,950 / 3,750 = 52.0 percent. With rising costs, FIFO shows the highest profit and the highest inventory value, because it matches old, low costs against current sales. LIFO shows the lowest profit and the lowest inventory value, because it matches the latest, higher costs to sales. Weighted average sits between. When costs fall, the pattern reverses. Total profit over the life of the business is the same in each method, since all the cost eventually gets expensed. The methods differ in timing.

Which methods are allowed

Rules differ by country and by the standards you follow. As far as we know, LIFO is permitted for financial reporting under US generally accepted accounting principles but not under International Financial Reporting Standards, and tax rules may require that a method used for tax be used in financial statements as well. Because the rules change and depend on your situation, choose a method with your accountant, and do not switch without checking the tax and reporting consequences. A change in method is normally disclosed and applied in a consistent way.

What the choice means for decisions

For management, the more important point is that none of these methods tells you the cost of replacing what you sold. In the example, the latest purchase cost $14, and a reported FIFO cost of $10.67 per unit sold (1,600 / 150) made the quarter look more profitable than it was on a replacement basis. If you set prices from FIFO cost in a rising market, you may end up selling below the cost of restocking. Look at both: the reported cost for accounting and the replacement cost for pricing. At a replacement cost of $14, the margin on a $25 sale is 44 percent (11 / 25), not the 57 percent shown by FIFO reporting.

Perpetual versus periodic systems

In a periodic system, you count inventory at the end of the period and calculate COGS from the formula. In a perpetual system, the accounting system updates inventory and COGS with each sale and receipt. Perpetual systems give a running view of margin and of stock, and they depend on accurate transaction recording. Periodic systems are simpler and can hide losses from theft, damage and errors, because shrink is buried in COGS. Many small businesses start periodic and move to perpetual as they grow.

Write-downs and obsolete stock

Inventory should not be carried above the amount it can be sold for. Under common accounting rules, inventory is valued at the lower of cost and net realizable value, which is the expected selling price less the costs of completion and sale. If 100 units cost $14 each ($1,400) and the market has fallen so that you expect to sell them for $12 less $1 of selling cost, the net realizable value is $11 per unit and the write-down is 100 × 3 = $300, charged to COGS in the period in which the decline is recognized. Review aged stock every month. Holding on to old stock at full cost overstates profit until the write-down arrives all at once.

Standard costing

Manufacturers and larger resellers often use a standard cost for each product, an agreed unit cost for the year, and track variances against actual cost. If the standard is $12 and the actual purchase cost was $13, there is an unfavorable purchase price variance of $1 per unit. Standards make reporting consistent and show where costs deviate. They must be updated when costs change materially, or the variances grow so large that they hide real performance.

Practical choices for a small business

  1. Use the method your accountant recommends for tax and keep it consistent.
  2. Keep a separate management view of replacement cost for pricing.
  3. Record freight, duty and receiving in the inventory cost. See landed cost.
  4. Count inventory regularly, even if you use a perpetual system.
  5. Reconcile the inventory in your records to the general ledger each month.
  6. Review slow-moving stock monthly and write down when needed.

Common mistakes

  • Using the wrong method without telling the accountant.
  • Pricing from reported cost in a rising market.
  • Skipping the reconciliation between inventory records and ledger.
  • Failing to write down obsolete stock.
  • Switching methods to improve a single period's results.

Specific identification

For unique or high-value items such as vehicles, art or custom equipment, businesses can track the actual cost of each item and expense that cost when that exact item is sold. It gives the most precise match of cost and revenue, and it is practical only when units are distinguishable and few in number. For interchangeable goods, it is usually impractical, and could allow profit to be managed by choosing which unit to sell, so it is limited in many places. Use FIFO or weighted average for ordinary stock.

FAQs

What is the COGS formula?

Beginning inventory plus purchases during the period, minus ending inventory.

What is the difference between FIFO and LIFO?

FIFO assumes the oldest units are sold first, and LIFO assumes the newest are sold first. With rising costs, FIFO gives higher profit and LIFO gives lower profit, because of the costs they match against sales.

Does the inventory method change total profit?

Not over the life of the business. It changes the timing of when costs are expensed.

Which method should I use?

The one your accountant recommends for your tax and reporting situation, applied consistently. Use replacement cost for pricing decisions.

What is net realizable value?

The expected selling price less the cost to complete and sell. Inventory should be carried at the lower of cost and net realizable value.

This article is for general information. It is not accounting, tax, legal or investment advice, and examples use illustrative numbers rather than client data. Confirm decisions that carry financial or legal consequences with a qualified professional.

Better forecasts. Healthier inventory. More working capital.

Newtown Analytics advises growing consumer-product companies on demand planning and inventory optimization.