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.

## Step By Step Guide For Calculating Cost Of Goods Sold

Laid out in the broadest possible terms, COGS can be calculated in three steps:

• Step 1: Determine the cost of goods by tallying the inventory on hand at the start of the period you are looking at, say the second quarter.
• Step 3: Subtract the amount you have on hand at the end of the quarter - your ending inventory - and, presto, you will have the cost of goods sold.
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.

## Taking Inventory With Costs Of Goods Sold

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.

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 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".

## Tallying Your Purchases With Costs Of Goods Sold

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.

## 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.

## Ready for the Full Formula

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!