Profit Margin Calculator for Excel

Calculate profit margin and a target selling price, then copy the formulas into Excel. The browser result uses the same B2-to-B4 cell layout shown in the guide.

Written and checked by TheToolNet Editorial Team · Last reviewed: September 27, 2026 · Editorial method

Excel formula

With revenue in B2 and cost in B3, use =(B2-B3)/B2, then format the cell as a percentage.

Calculate and build the Excel formulas

Excel worksheet setup

CellLabelEntry or formula
B2Revenue / selling price100
B3Cost60
B4Target margin45%
B5Profit=B2-B3
B6Actual margin=(B2-B3)/B2
B7Price for target margin=B3/(1-B4)

Percentage entry matters

Enter a target as 45% or 0.45, not plain 45. Excel stores percentages as decimals. Format B4 and B6 as Percentage, and the amount cells as Currency or Number.

Margin is not markup

The margin formula divides profit by revenue. Markup divides profit by cost. If your pricing sheet uses markup, the target-price formula is =B3*(1+B4) instead. Compare the two with the margin vs markup calculator.

Rows for multiple products

Place revenue in column B and cost in column C, then enter =(B2-C2)/B2 in D2 and fill downward. Use structured table references when your workbook is an Excel Table. Guard zero-revenue rows with =IFERROR((B2-C2)/B2,"").

Frequently asked questions

Can I calculate gross margin with this formula?

Yes, when revenue and cost of goods sold are the two inputs. Other profit margins require the corresponding expense definition.

Why does my percentage show 4000%?

The formula already returns a decimal. Do not multiply by 100 before applying Percentage formatting.