COGS=Beginning Inventory+P−Ending Inventory where P=Purchases during the period
COGS - Taken as the cost of making or producing the items sold. The items not sold are not part of COGS but of finished goods inventory.
In the cell b16 you may adjust your variable costs, then change the percentage in corresponding cells, i.e.d16, E16 and F16
