How to Calculate Profit on Inventory — And Why Your Numbers May Be Wrong

How to Calculate Profit on Inventory — And Why Your Numbers May Be Wrong

ZA
Zain Ul Din@zainuldin
21 September 20269 min read
FinTechEdTech

I used to think calculating profit was pretty straightforward.

You buy something for Rs. 1,000.

You sell it for Rs. 1,500.

You made Rs. 500.

Simple, right?

Turns out, once you actually try building accounting software, it gets messy pretty fast.

What happens if you bought the same item three times at different prices?

What about freight?

Loading and unloading charges?

Returns?

What if someone goes back and edits a purchase from two months ago after half of that stock has already been sold?

And if you're manufacturing something instead of simply buying and reselling it, things get even more interesting.

While building ClearBook, this was one of the areas that made me realize that recording a sale is easy. Figuring out what that sale actually cost you is the difficult part.

Let's break it down without turning this into an accounting lecture.

First, what do we actually mean by profit?

Let's say you bought a bag of rice for:

Rs. 10,000

and sold it for:

Rs. 12,000

At first glance:

Rs. 12,000 - Rs. 10,000 = Rs. 2,000 profit

That Rs. 2,000 is closer to your gross profit on the item.

A simple version of the formula is:

Gross Profit = Sales Revenue - Cost of Goods Sold

Your actual business profit is another story.

You still have things like:

  • shop rent
  • salaries
  • electricity
  • internet
  • marketing
  • office expenses
  • taxes
  • other operating costs

So if your inventory made Rs. 200,000 in gross profit this month, that doesn't necessarily mean you took Rs. 200,000 home.

For this article, I'm mostly talking about inventory profit and cost of goods sold, because that's where things get surprisingly complicated.

The purchase price isn't always the actual cost

Suppose your business buys 100 bags of rice.

The supplier charges:

Rs. 1,000,000

You might assume your inventory cost is Rs. 1,000,000.

But you also paid:

  • Rs. 40,000 freight
  • Rs. 10,000 loading and unloading

Now getting that stock into your warehouse actually cost:

Rs. 1,050,000

That changes the cost per bag from:

Rs. 10,000

to:

Rs. 10,500

That's already a Rs. 500 difference per bag.

If you sell a bag for Rs. 12,000 and use only the supplier price, your system might make it look like you earned:

Rs. 2,000

But based on this simplified example, your gross profit after considering those directly attributable inventory costs would be:

Rs. 1,500

That's a 25% difference in the profit number.

This isn't just some accounting trick.

Under IAS 2, inventory cost can include purchase costs, transport, handling and other costs directly attributable to bringing inventory to its present location and condition. Manufacturing inventory can also include conversion costs such as direct labour and allocated production overhead.

Not every business expense belongs inside inventory, though.

Your general office expenses, selling costs and unrelated administrative expenses don't suddenly become part of the product just because you paid them during the same month.

And this is where accounting software needs to know the difference.

Now buy the same item at three different prices

Here's where it starts getting more interesting.

Imagine you run a retail business and purchase the same product in three batches.

Batch 1

10 units × Rs. 1,000

Batch 2

10 units × Rs. 1,100

Batch 3

10 units × Rs. 1,300

You now have 30 identical-looking units sitting in your shop.

A customer walks in and buys 5 units for Rs. 1,500 each.

So...

What did those five units cost you?

You can't just say Rs. 1,000 anymore.

You have inventory sitting there that entered the business at three different costs.

This is why inventory costing methods exist.

FIFO, weighted average and specific costs

There are multiple legitimate ways accounting systems can assign costs to inventory.

FIFO

FIFO means First In, First Out.

The assumption is that the stock you purchased first gets sold first.

Using our example, those first five units would carry the Rs. 1,000 cost.

You sold them for Rs. 1,500 each.

So:

Selling price: Rs. 7,500 Cost: Rs. 5,000 Gross profit: Rs. 2,500

Simple enough.

Weighted average

Instead of tracking which particular batch was sold, a system can calculate an average cost across the inventory.

In our simplified example:

(10,000 + 11,000 + 13,000) / 30

Average cost per unit:

≈ Rs. 1,133

The five units would therefore have a cost of around:

Rs. 5,667

Now the gross profit is roughly:

Rs. 1,833

Same sale.

Different valid costing approach.

Different profit number.

Specific identification / lot-based cost

Sometimes you actually know which inventory was sold.

Maybe a particular batch has its own lot.

Maybe the business sells commodities purchased at significantly different prices.

Maybe products have serial numbers.

Or perhaps keeping the original cost attached to a specific lot simply gives the business better traceability.

In that situation, the cost associated with the actual inventory being sold can be tracked directly.

IAS 2 allows specific identification where inventory items are not ordinarily interchangeable, while FIFO and weighted average are recognised cost formulas for interchangeable inventory.

So the point isn't:

“FIFO is correct and average is wrong.”

Or:

“Lot costing is always better.”

The important question is:

Do you know how your software arrived at the cost behind your profit number?

Because seeing:

Profit: Rs. 183,450

isn't very useful if nobody can explain where Rs. 183,450 came from.

And then somebody edits an old purchase

This was one of the more interesting cases I ran into while working on ClearBook.

Imagine this:

On January 1, you purchased:

100 units @ Rs. 1,000

On January 5, you sold:

40 units @ Rs. 1,300

Initially, the system calculates:

Revenue: Rs. 52,000 Cost: Rs. 40,000 Gross profit: Rs. 12,000

A few weeks later, someone notices that the original purchase invoice was entered incorrectly.

The actual purchase rate wasn't Rs. 1,000.

It was:

Rs. 1,100

Easy fix, right?

Just change the purchase.

Except 40 of those items have already been sold.

Those units didn't really cost Rs. 40,000.

They cost:

Rs. 44,000

So the profit from those sales should now be:

Rs. 8,000

rather than Rs. 12,000.

And now the accounting system has to decide how that correction flows through the inventory records and financial accounts.

This is one of those things that's almost invisible to the person using the software.

They just edited a number.

Behind that one number might be purchases, inventory valuation, cost of goods sold, historical profit and ledger entries that all need to remain consistent.

That's why deleting transactions or blindly changing database rows isn't really an accounting system.

Returns create the same kind of problem

Let's say you sold 10 units.

The customer later returns three.

What happens?

Those three units aren't simply “unsold.”

The software may need to reverse the revenue, reverse the cost associated with those units, restore inventory, adjust the customer's balance and keep the ledger consistent.

Purchase returns have the same problem in the other direction.

This is why proper accounting systems often work with reversal and return entries rather than pretending the original transaction never happened.

You want to be able to answer:

What happened?

not just:

What does the database look like right now?

Manufacturing makes inventory profit even more interesting

Retail is the easy version.

Let's take a small flour mill.

The mill buys wheat.

That wheat has:

  • a purchase price
  • transportation cost
  • loading/unloading cost
  • potentially other directly attributable costs

But the mill doesn't sell the wheat as-is.

It processes it.

Now there are production costs.

Workers operate machinery.

Electricity is consumed.

Raw materials are converted into finished goods.

You may even get multiple outputs or by-products depending on the manufacturing process.

So now you're no longer asking:

How much did I buy this bag for?

You're asking:

How much did it cost us to produce this finished inventory?

Under IAS 2, inventory conversion costs can include costs directly related to production, such as direct labour, along with systematic allocations of fixed and variable production overhead used to convert materials into finished goods.

That finished inventory then sits in stock.

When it's eventually sold, its carrying cost becomes part of cost of goods sold.

So you can roughly think of the flow as:

Raw Material → Production → Finished Inventory → Sale → COGS → Gross Profit

This is why manufacturing accounting can get difficult very quickly in an Excel sheet.

Your accounting software should hide most of this from you

The funny thing is that a normal business owner probably shouldn't need to think about most of what I just explained.

They should be able to record:

Bought 100 bags from Supplier A

then:

Paid Rs. 20,000 freight

then:

Sold 15 bags to Customer B

and the accounting system should take care of what needs to happen underneath.

That's one of the ideas behind ClearBook.

I wanted proper accounting underneath without forcing someone running a shop, trading business or mill to constantly think in debit and credit.

ClearBook is a desktop accounting system built for trading, retail and manufacturing businesses in Pakistan. It includes inventory and lot management, sales and purchases, returns and reversals, payments, ledgers, item-wise profit/loss and a production module for mills and factories. It uses double-entry accounting underneath while trying to keep the interface understandable for people who aren't accountants.

That abstraction matters.

A person using the software should care about their business.

The software should care about keeping the books consistent.

So how should you calculate inventory profit?

For a simple business, start here:

Gross Profit = Sales Revenue - Cost of Goods Sold

But don't stop at:

Cost = supplier invoice price

Ask what actually forms the inventory cost.

Were there directly attributable freight or handling costs?

Did you purchase the same item at different rates?

Which costing method are you using?

Did any of the inventory come back through a return?

Were historical purchases edited?

Are you manufacturing the finished goods yourself?

Once those things enter the picture, “I bought it for Rs. 1,000 and sold it for Rs. 1,500” stops telling the whole story.

And that's really the main takeaway.

Your accounting software showing you a profit number isn't enough.

You should be able to trust how it got there.

If you run a retail, trading or manufacturing business in Pakistan and don't want to manually deal with all of these inventory and accounting mechanics, you can check out ClearBook and see how we're approaching the problem.

How to Calculate Profit on Inventory — And Why Your Numbers May Be Wrong | Findio.pk