Excel formula for percentage: part, total, margin, change

The Excel formula for percentage is the part divided by the total. =B2/B3 with 18 and 72 returns 0.25, and a percent format shows 25%. A $50 price on a $30 cost is a 40% margin. Markup on that cost shows as 66.67%. From 40 to 50, the percent change is 25%.

Percentage of a total

A percentage in this sheet is a ratio. The cell stores 0.25, not the number 25. Typing 25 and then formatting as a percent stores 2500%, which is not this share.

=18/72
ROUND
=B2/B3
=B2/B3B4
18 of 72
AB
1Value
2Part18
3Whole72
4Share25%
A picture of one share. 18 divided by 72 is 0.25. A percent format shows 25%. The cell stores the ratio, not the number 25.

Margin and markup percentage

xl.margin divides profit by the selling price. A $50 price and a $30 cost leave $20 of profit. 20 / 50 is 0.40, which shows as 40%. Markup divides that same $20 by the cost. xl.markup is that division. 20 / 30 is 0.6666…. ROUND to four decimal places is 0.6667, because the next digit is 6. A percent format with two decimals shows 66.67%. Markup vs margin uses this same $50 price and $30 cost.

xl.margin
=(B2-B3)/B2
=(B2-B3)/B2B4
Price and cost
AB
1Value
2Price50
3Cost30
4Margin40%
5Markup66.67%
A picture of a $50 price and a $30 cost. Profit is 20. 20 divided by 50 is 0.40, shown as 40%. ROUND of 20/30 to four decimals is 0.6667, shown as 66.67%.
=xl.margin(50, 30)
=ROUND(20/30, 4)

The margin name returns 0.40. A price of 0 is #N/A. xl.markup returns #N/A when the cost is 0. Both names need Microsoft 365, Excel 2024, or Excel for the web. Excel 2021 returns #NAME?. The division works without them. Saving a name is the same Name Manager step as the LAMBDA how-to.

Percent change formula

xl.percent.change is (new − old) / old. From 40 to 50 that is 10 / 40 = 0.25, the same 25% as 18 / 72, on a different pair of numbers. A starting value of 0 is #N/A.

The net-worth walkthrough uses a longer pair. How to calculate percentage change in Excel goes from $42,000 on December 31, 2025 to $44,100 on January 31, 2026, which is 5%, and then to $43,050, which shows as −2.38%.

The workbook that keeps a price and a cost together is the product pricing calculator.

Questions

How do I calculate a percentage of a total?

Divide the part by the total. 18 divided by 72 is 0.25, which a percent format shows as 25%. PERCENTOF is the sum of a subset divided by the sum of the whole set. =PERCENTOF(B2,B3) with 18 and 72 returns 0.25, the same as =SUM(B2)/SUM(B3). PERCENTOF needs Microsoft 365 or Excel for the web. Excel 2024, Excel 2021, and Excel 2019 return #NAME?. =B2/B3 returns the same 0.25 in those versions. A total of 0 is #DIV/0!.

How do I increase a number by a percentage?

Multiply by one plus the rate. =B2*(1+C2) returns 50 when B2 is 40 and C2 is 25%. C2 has to store 0.25. If C2 stores 25, the formula returns 1,040. How to add sales tax in Excel adds a rate on top of a price.

How do I show 25 as 25% instead of 2500%?

Store 0.25 and format the cell as a percent. The cell shows 25%. The number 25 with a percent format shows 2500%, because that format multiplies the display by 100. TEXT writes a label: =TEXT(18/72,"0%") returns the text 25%. SUM ignores text. Use the percent format when the cell still has to be a number.

What is the Excel formula for margin and markup?

On the price picture, margin is =(B2-B3)/B2. A $50 price and a $30 cost leave $20 of profit, and 20/50 is 40%. Markup is =ROUND((B2-B3)/B3,4), which is 0.6667 and shows as 66.67%.


Template for this article

Product Pricing Calculator

More from the blog