While it's easier to use the Omni Margin Calculator, it is useful to know how to calculate margin in Excel:
Input the cost of goods sold (for example, into cell A1).
Input your revenue on the product (for example, into cell B1).
Calculate profit by subtracting cost from revenue (In C1, input =B1-A1) and label it “profit”.
Divide profit by revenue and multiply it by 100 (In D1, input =(C1/B1)*100) and label it “margin”.
Right click on the final cell and select Format Cells.
In the Format Cells box, under Number, select Percentage and specify your desired number of decimal places.
Read more