COGS is the costs that go into creating the products that a company sells; therefore, the only costs included in the measure are those that are directly tied to the production of the products.
For example, the COGS for an automaker would include the material costs for the parts that go into making the car along with the labor costs used to put the car together. The cost of sending the cars to dealerships and the cost of the labor used to sell the car would be excluded. The exact costs included in the COGS calculation will differ from one type of business to another.
The cost of goods attributed to a company's products are expensed as the company sells these goods. There are several ways to calculate COGS but one of the more basic ways is to start with the beginning inventory for the period and add the total amount of purchases made during the period then deducting the ending inventory. This calculation gives the total amount of inventory or, more specifically, the cost of this inventory, sold by the company during the period. Therefore, if a company starts with $10 million in inventory, makes $2 million in purchases and ends the period with $9 million in inventory, the company's cost of goods for the period would be $3 million ($10 million + $2 million - $9 million).