The cost of merchandise sold formula, also known as COGS, is a calculation used by businesses to determine their operating costs and profit margins. It measures the total direct cost associated with producing and selling products or services. To calculate the formula, add up all the expenditures directly related to bringing a product or service to market. This includes direct material costs, labor costs, shipping expenses, and any other costs that are closely tied to production. By subtracting these costs from the revenue generated, it gives companies an accurate idea of how much money they made on each sale. Knowing this number can help businesses plan for future investments and stay in the black.