# How to calculate profit margin percentage in Excel

If you need to calculate a profit margin, you can easily do so with a simple formula that uses the sale price and the cost.

## Formula

=(price-cost)/price

## Explanation

In the example shown, the first formula looks like this:

=(B4-C4)/B4

Make sure you use parentheses to control the order of operations.

Note that the result will be a decimal like 0.40, so you need to format the cell with the Percentage number format (use the ribbon or Ctrl + 1 to access all number formats).