Want to start your own business? Thinking of opening a toy shop or small manufacturing business?

There are a million details to master if you want to be your own boss, especially if you are planning to launch a retail business or a company that makes things.

You'll need investors and financing, a space to do business in, and potentially machinery as well.

But you'll also need to have a grasp of basic accounting principles, even if you have a trusted accountant or CPA you plan to work with.

And one fundamental concept you'll need to learn is the "cost of goods sold," or COGS, which deals with material and labor costs.

In order to determine the profitability of your venture - and how much you owe Uncle Sam - you must master this metric.

What is Cost of Goods Sold (COGS)?

The cost of goods sold for a business is essentially the amount of costs in a given period required to manufacture and sell the business's goods. Depending on the type of business, the cost of goods sold can be much easier or much more difficult to calculate. A retailer, for example, has a pretty clear understanding of what the goods and inventory are that are needed in the calculation. A different industry with more manufacturing requirements may require a more complicated calculation.

The cost of goods sold is often listed on the company's income statement, and is subtracted when calculating a company's gross income. If a company has a particularly high COGS, a prospective investor may look at the income statement and see it as a big reason the company's profit isn't as high as it could be, and decline to invest as a result. A more manageable COGS, though, would help lead to a more impressive figure for gross income.

How to Calculate Cost Of Goods Sold: Step-By-Step Guide

Laid out in the broadest possible terms, COGS can be calculated in three steps that culminate in one formula.

Or, to put it another way, the formula for calculating COGS is: Starting inventory + purchases - ending inventory = cost of goods sold.

No arcane exercise in accounting, you'll subtract the cost of goods sold from your revenue on your taxes to determine how much you made in profits - and how much you owe the feds.

Higher costs mean lower taxes but also lower profits, which, for obvious reasons, isn't good for any business.

Ready for some number crunching? Well, here we go.

1. Tally Initial Inventory

While the math for determining COGS is simple, there are a number of details you'll need to nail down to do this calculation correctly. The first detail you're going to need is the inventory your business had at the start of the relevant period or quarter, and how to tally it all up.

If you have taken inventory, you know how many barrels of beer, or dresses or whatever else you had on hand at the start of the quarter.

Now you need a dollar figure. If you are a small retailer or wholesaler, this question is pretty self-evident - it's what it cost to buy your inventory from the factory owner or other supplier.

However, if you are a factory owner and the warehouse you are counting inventory in is full of your goods, then you will have to dig a bit deeper.

Manufacturers or mine owners must determine the labor costs to produce the stock or products in question, which are the direct costs.

But indirect costs can also count. The IRS defines indirect costs as: "Rent on building used in manufacturing operation; depreciation of building/equipment; salaries for production supervisor and others indirectly involved; warehousing costs; and bottling and packaging labor.

And don't forget the materials and supplies you used in the manufacturing process, such as chemicals and hardware.

Falling in the category of "other costs" are "containers, freight-in" and "overhead expenses".

2. Add Additional Purchases

The second part of the COGS formula calls for tabulating whatever purchases or additions you made to your inventory over the period or quarter in question.

If your company makes things instead of reselling them, this includes "the cost of all raw materials or parts purchased for merchandise on hand at the beginning of the year manufactured into a finished product," according to the IRS. If the materials were acquired at a discount, you'll need to use the original number before the savings were shaved off.

Returns from customers and products or goods taken from family or personal use have to be subtracted from purchases made during the quarter.

One example of how raw materials are counted as part of the cost of goods sold can be found in the story of the impact of falling cocoa prices on Hershey Co. (HSY) - Get Report Cocoa prices make up 10% to 15% of Hershey's cost of goods sold. A 37% plunge last year in the price of cocoa meant a big jump in profitability for Hershey.

3. Tally Ending Inventory

You've got most of the figures you need after those steps, but there's still one important one left: the cost of your inventory at the end of the relevant time period.

Tallying up the costs of your ending inventory entails the same steps as your beginning inventory, and once you've done it you have all the necessary calculations.

4. Calculate Cost of Goods Sold

From there, you now have what you need to do a calculation of the cost of goods sold for your business.

For example, imagine you're calculating the cost of goods sold for a retailer over the past year. Using the three steps prior, you've determined that their inventory costs at the beginning of the year were $300,000, they made $400,000 worth of purchases throughout the year and had inventory costs of $150,000 at the end of the year. Using the formula for costs of good sold, we see that:

$300,000 + $400,000 = $700,000 - $150,000 = $550,000

The cost of goods sold over the year for this retailer was $550,000.

Choose an Accounting Method

You'll also need to pick an overall accounting approach that you will use when you take stock of your company's inventory.

Whether you make your own products or are a wholesaler, you face the same basic fact of the business world - the price of just about everything is changing all the time. That means all the goods in your warehouse are worth more or less depending on when they were acquired or made.

There are three basic choices here:

First-In, First-Out, or FIFO

Under this method, you assume the oldest units of inventory are always sold first.

Last-In, First-Out, or LIFO

This is the opposite approach, in which the newest inventory is sold before the oldest.

Average cost

This is fairly self-explanatory and involves hammering out an average cost for units of inventory sold. The first calculation is done in dollars. You take the dollar value of your starting inventory and add your purchases. Your second calculation is done on a per unit basis - you tally the number of units you started with and add the number you purchased over the quarter. You then divide the dollar inventory figure by the unit inventory figure to get average cost per unit.

Full Formula for Calculating Cost of Goods Sold

As you can see, the cost of goods formula that we started off with was an abbreviated version. Now that we know all the components that got hammering out the cost of goods sold, we can move on to a fuller and more useful version.

Here's how the IRS describes it:

(Inventory at the beginning of the year + net purchases + cost of labor + materials and supplies + other costs) - inventory at the end of the year = Costs Of Goods Sold (COGS)

Happy number crunching!