Find gross profit
Gross profit is selling price minus cost. If an item sells for 80 and costs 60, the gross profit is 20. A selling price below cost produces a loss.
Margin vs. markup
Gross margin divides profit by the selling price. Markup divides profit by the cost. In the example, margin is 25% and markup is about 33.33%.
When a ratio is undefined
A selling price of zero makes the margin undefined. A cost of zero makes the markup undefined. The dollar profit can still be computed in either case.