Summary
To calculate profit margin as a percentage with a formula, subtract the cost from the price and divide the result by the price. In the example shown, the formula in cell F5 is:
=(C5-D5)/C5
The results in column F are decimal values with the percentage number format applied.
Generic formula
=(price-cost)/price
Explanation
In this example, the goal is to calculate and display profit margin as a percentage for each of the items shown in the table. In other words, given a price of $5.00 and a cost of $4.00, we want to return a profit margin of 20%. Each item in the table has different price and cost, so the profit varies across items.
Profit margin is the ratio of profit divided by revenue. The general formula where "x" is profit margin is:
x=profit/price
In the table shown, we have price and cost, but profit is not broken out separately in another column, so we need to calculate profit by subtracting Cost from Price:
x=(price-cost)/price
x=(5-4)/5
x=1/5
x=0.20
After we convert this to an Excel formula with cell references, we have this formula in F5:
=(C5-D5)/C5
=(5-4)/5
=1/5
=0.20
Make sure you use parentheses to control the order of operations. As the formula is copied down, we get profit margin for each item in the table. Note the result will be a decimal number like .10, .25, .30, etc. To display this result as a percentage, apply Percentage number format. You can use the keyboard shortcut Control + Shift + %.
Profit margin is not the same as markup. Margin divides the profit by the price, while markup divides it by the cost:
=(C5-D5)/D5. For the first item, the margin is 20% and the markup is 25%.