Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
The standard Excel formula for profit margin percentage is:
=(Selling Price-Cost Price)/Selling Price
If the cost is in A2 and the selling price is in B2, use:
=(B2-A2)/B2
For a $100 cost and $150 selling price, the profit is $50 and the profit margin is 33.33%. Format the result cell as a percentage; do not multiply the formula by 100.
Profit percentage formula in Excel
In everyday business language, “profit percentage” can mean either profit margin or markup. The denominator determines which calculation you are making:
#1 Best Overall
- The Microsoft Office 365 Bible: The Most Updated and Complete Guide to Excel, Word, PowerPoint, Outlook, OneNote, OneDrive, Teams, Access, and Publisher from Beginners to Advanced
- ABIS BOOK
- Profit margin: profit divided by selling price or revenue.
- Markup: profit divided by cost.
For most sales and business reporting, the intended figure is usually profit margin:
Profit = Selling Price - Cost Price
Profit Margin = Profit / Selling Price
Excel formulas begin with =, use - for subtraction, and use / for division. Parentheses ensure Excel calculates the profit before dividing it.
| Cost Price | Selling Price | Profit % |
|---|---|---|
| 100 | 150 | =(B2-A2)/B2 |
The formula returns approximately 0.3333. Once the cell is formatted as a percentage, Excel displays 33.33%.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Microsoft’s Excel guidance explains the basic operators used in formulas, while its percentage-formatting guidance explains how decimal values are displayed as percentages.
Method 1: Calculate profit percentage directly
This is the quickest method when your worksheet contains only the cost and selling price.
Assume:
A2contains the cost price.B2contains the selling price.
Enter this formula in the result cell:
=(B2-A2)/B2
With a cost of $100 and selling price of $150:
- Profit: $150 − $100 = $50
- Margin: $50 ÷ $150 = 0.3333
- Displayed percentage: 33.33%
Best for: quick calculations, small worksheets, and product lists where you do not need a separate profit column.
Limitation: the formula shows the percentage but not the dollar profit. You can calculate the profit separately if you need both figures.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Copying the formula down
When you copy =(B2-A2)/B2 from row 2 to row 3, Excel normally changes it to =(B3-A3)/B3. These are relative references, so each row uses its own cost and selling price.
Rank #2
Method 2: Calculate profit first, then the percentage
Using separate columns makes the worksheet easier to read, check, and expand later.
Set up the columns like this:
| Column | Contents |
|---|---|
| A | Cost |
| B | Selling Price |
| C | Profit |
| D | Profit % |
In C2, calculate the dollar profit:
=B2-A2
In D2, calculate the margin:
=C2/B2
Format D2 as a percentage. For $100 cost and $150 selling price, C2 returns $50 and D2 displays 33.33%.
Best for: business reports, financial models, product catalogs, and any workbook where another person may need to audit the calculation.
This layout is also easier to adapt when you later subtract discounts, marketplace fees, shipping, or other variable expenses.
Method 3: Use an Excel Table with structured references
An Excel Table is useful for inventory lists, ecommerce catalogs, and transaction data that will grow over time.
- Select the range containing your data.
- Press
Ctrl+T. - Confirm that My table has headers is selected.
- Add columns named Cost Price, Selling Price, Profit, and Profit %.
- Enter the formula below in the first cell of the Profit % column.
=([@[Selling Price]]-[@[Cost Price]])/[@[Selling Price]]
Excel will generally fill the formula through the calculated column and apply it to new rows added to the Table.
If the Table already has a Profit column, use:
=[@Profit]/[@[Selling Price]]
To suppress errors from blank or zero selling prices, use:
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problems=IFERROR(([@[Selling Price]]-[@[Cost Price]])/[@[Selling Price]],"")
Best for: repeated sales records, growing product lists, and workbooks where automatic formula propagation is more important than using the shortest possible formula.
Structured references are more readable once familiar, although beginners may find ordinary references such as =(B2-A2)/B2 easier at first.
How to format the result as a percentage
- Select the cell or range containing the formula.
- Open the Home tab.
- In the Number group, select Percent Style (%).
- Use the increase- or decrease-decimal buttons to choose the displayed precision.
On Windows, the keyboard shortcut is:
Ctrl+Shift+%
Excel stores 33.33% as approximately 0.3333 and uses percentage formatting to display it as 33.33%. Therefore, use:
=(B2-A2)/B2
rather than multiplying by 100.
The formula below can produce the number 33.33 when the cell uses General formatting:
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11=((B2-A2)/B2)*100
That is not automatically mathematically wrong, but it is easy to create a display error if you then apply Percentage formatting. The cell may show 3333%. The safer standard is to return the decimal and apply percentage formatting.
Microsoft notes that formatting a stored whole number such as 10 as a percentage displays 1000%, because Excel interprets the value as 10 rather than 0.10. This is why formatting and formula design need to be treated separately.
Profit margin versus markup
Using the same $100 cost and $150 selling price:
| Metric | Formula | Result |
|---|---|---|
| Profit | Selling price − cost | $50 |
| Profit margin | Profit ÷ selling price | 33.33% |
| Markup | Profit ÷ cost | 50% |
In Excel, markup is:
=(B2-A2)/A2
A 50% markup on a $100 cost creates a $150 selling price, but that produces only a 33.33% profit margin. Always state whether the percentage is based on cost or selling price.
Handling errors and special cases
Selling price is zero
The standard margin formula divides by selling price, so a zero selling price produces #DIV/0!. A zero selling price does not represent a zero margin; the margin is undefined because there is no revenue denominator.
Recommended Free Tools
Use a message:
=IF(B2=0,"N/A",(B2-A2)/B2)
Or return a blank:
=IFERROR((B2-A2)/B2,"")
Selling price or cost is blank
When copying formulas down a partially completed worksheet, explicitly check for missing inputs:
=IF(OR(A2="",B2=""),"",(B2-A2)/B2)
This prevents incomplete rows from displaying misleading results.
For an Excel Table, use:
=IF(OR([@[Cost Price]]="",[@[Selling Price]]=""),"",([@[Selling Price]]-[@[Cost Price]])/[@[Selling Price]])
Cost is greater than selling price
A negative result is valid. If cost is $120 and selling price is $100:
=(100-120)/100
Excel returns -20%. This is a loss margin, or negative profit margin, rather than a formula error.
Free tools Windows power users keep installed
One-click scans. No signup required.
Cost is zero
If cost is zero and selling price is positive, the formula returns 100%. That may be mathematically correct for the inputs, but it can be commercially unrealistic if shipping, labor, packaging, fees, taxes, or overhead were omitted.
Discounts, fees, refunds, and taxes
The result is only as meaningful as the inputs. Decide what “cost” and “selling price” represent before building the formula.
Possible costs include:
- Purchase or manufacturing cost
- Shipping and fulfillment
- Packaging
- Marketplace and payment-processing fees
- Labor
- Advertising allocation
- Returns and refunds
- Import duties and overhead
For a simple gross-style margin based on product cost:
=(Selling Price-Product Cost)/Selling Price
For a more complete contribution margin:
=(Revenue-Product Cost-Variable Fees-Shipping-Other Variable Costs)/Revenue
For net profit margin:
=Net Profit/Revenue
Product cost alone does not necessarily measure total business profitability.
Calculating total profit margin for multiple products
For a combined result, calculate total profit divided by total sales:
Best Value
=SUM(C2:C10)/SUM(B2:B10)
Here, column C contains profit and column B contains selling price or revenue.
Do not automatically use:
=AVERAGE(D2:D10)
A simple average gives every product equal weight, even when their selling prices differ. The weighted calculation reflects the actual contribution of each product to total revenue.
Calculating a selling price from a target percentage
Target profit margin
If A2 contains cost and C2 contains a target margin entered as 30%, use:
=A2/(1-C2)
For a $100 cost and 30% target margin, the selling price is $142.86. The profit is $42.86, and $42.86 ÷ $142.86 equals 30%.
Target markup
If A2 contains cost and C2 contains a target markup entered as 30%, use:
=A2*(1+C2)
For a $100 cost and 30% markup, the selling price is $130. The resulting margin is approximately 23.08%, not 30%.
Using fixed assumptions when copying formulas
If a fee percentage is stored in E1 and must remain fixed as you copy a formula down, use an absolute reference:
=(B2-A2-B2*$E$1)/B2
The $E$1 reference stays fixed while row references change. Microsoft’s guidance on copying percentage formulas describes this use of absolute references.
Quick reference
| Goal | Excel formula |
|---|---|
| Profit amount | =SellingPrice-CostPrice |
| Profit margin | =(SellingPrice-CostPrice)/SellingPrice |
| Markup | =(SellingPrice-CostPrice)/CostPrice |
| Price for target margin | =CostPrice/(1-TargetMargin) |
| Price for target markup | =CostPrice*(1+TargetMarkup) |
Choosing the right method
- Use the direct formula when you need a compact calculation from cost and selling price.
- Use the helper-column method when you need to show and audit both dollar profit and percentage.
- Use an Excel Table when your product or transaction list will grow and formulas should extend automatically.
For a one-off calculation, Excel for the web can be used with a Microsoft account. Desktop Excel is more appropriate when you need advanced workbooks, existing Excel-specific files, or broader Microsoft 365 integration. Google Sheets is a practical browser-based alternative when collaboration and sharing matter. Neither paid software nor accounting software is required for the calculation itself.
The essential rule is simple: divide profit by selling price for margin, divide profit by cost for markup, and format the resulting decimal as a percentage.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

