Excel guide · 5 min read
How to calculate ROI in Excel
=(C2-B2)/B2, with the cost in B2 and the total money it brought back in C2, formatted as a percentage. A $2,400 email campaign that brought back $9,100 has an ROI of 279%. To compare investments held for different lengths of time, annualize it with =(C2/B2)^(1/D2)-1, where D2 is the number of years.Sample data
Every result on this page was calculated from this sheet by the same spreadsheet engine the Cellwise app uses.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Project | Cost | Return | Years |
| 2 | Spring email campaign | 2400 | 9100 | 0.25 |
| 3 | Paid search ads | 18500 | 31200 | 1 |
| 4 | Trade show booth | 12750 | 10900 | 1 |
| 5 | Staff sales training | 9800 | 15600 | 2 |
| 6 | CNC machine | 85000 | 142000 | 4 |
| 7 | Rooftop solar panels | 46000 | 71500 | 6 |
Download this sheet as an Excel practice file (.xlsx)
The basic ROI formula
The sheet lists six things a small manufacturer spent money on, what each one cost, and the total money it brought back. Subtract the cost from the return to get the gain, then divide by the cost. The brackets matter: =C2-B2/B2 divides first and gives a nonsense number.
The result is a decimal, 2.79. Select the cell and press Ctrl+Shift+% (Home > Number > Percent Style) to show it as a percentage. An ROI of 279% means every dollar spent came back as $3.79: the dollar itself plus $2.79 of gain. To fill the whole column, enter the formula in E2 and double-click the fill handle.
Result: 2.7916666667 shows as 279% with Percent format
2.79, which shows as 279% with Percent Style. The campaign gained $6,700 on $2,400.
What counts as "return": the gotcha that inflates ROI
ROI only means something if the return is money you actually gained, after the costs of earning it. For a marketing campaign, the $9,100 here is the extra gross profit from the sales it brought in, not the sales revenue. If you put revenue in column C, a campaign that sold $9,100 of product that cost you $5,000 to make looks like 279% when the real ROI is far lower.
Revenue divided by ad spend has its own name, ROAS (return on ad spend), and many ad dashboards report it. It is useful, but it is not ROI. Decide what goes into cost the same way: include the designer's fee and the software, not just the ad budget, and use the same rules for every row so the comparison is fair.
If your return column already holds the gain (profit after costs), do not subtract the cost again. Then ROI is simply =C2/B2.
Negative ROI and comparing projects
The trade show cost $12,750 and brought back $10,900, so the gain is negative and the ROI is about -14.5%. Excel needs nothing special for this; the same formula works. To make losses stand out, use a number format that puts negatives in red, such as 0.0%;[Red]-0.0%.
To rank all six projects in one step in Excel 365 or 2021, SORTBY sorts the names by ROI from highest to lowest. HSTACK puts the ROI next to each name so you can see the numbers too. The ROI is calculated on the fly, so no helper column is needed.
Result: spills 6 rows × 2 columns
| Spring email campaign | 2.7916666667 |
| Paid search ads | 0.68648648649 |
| CNC machine | 0.67058823529 |
| Staff sales training | 0.59183673469 |
| Rooftop solar panels | 0.55434782609 |
| Trade show booth | -0.14509803922 |
Spring email campaign 279%, Paid search ads 69%, CNC machine 67%, Staff sales training 59%, Rooftop solar panels 55%, Trade show booth -15%. The ROI column shows as decimals until you format it as a percentage.
Annualized ROI: fair comparison over different time spans
Plain ROI ignores time. The CNC machine's 67% took four years; the paid search's 69% took one. Annualized ROI asks what steady yearly rate would turn the cost into the return over that many years: (return/cost)^(1/years)-1. It is the same calculation as CAGR.
For the CNC machine that is about 13.7% a year, against 68.6% for paid search and 7.6% for the solar panels over six years. The ranking changes completely once time is included.
Annualizing assumes all the return arrives at the end. If an investment pays back a bit every year, like solar savings, this understates it; use IRR on the yearly cash flows instead.
Result: 0.13688714188 shows as 13.7% with Percent format
0.137, which shows as 13.7%: the CNC machine's yearly rate, compared with its 67% total ROI.
Do not annualize short campaigns
The email campaign ran for three months, so years is 0.25. Annualizing raises 3.79 to the power of 4, which claims the campaign returns about 20,569% a year. That assumes you could reinvest the gain every quarter at the same rate, which no email list will let you do. Annualized ROI is for comparing investments of a year or more; for short campaigns, report the plain ROI and the period, for example "279% over 3 months".
Result: 205.69054121 shows as 20569% with Percent format
205.69, which shows as 20569%. Mathematically correct, practically meaningless.
Total ROI for a group, and which method to pick
For the ROI of everything together, add up the gains and the costs first, then divide. Averaging the six ROI percentages gives about 86%, because the tiny $2,400 campaign counts as much as the $85,000 machine. The correct overall figure is about 61%.
Which to use: plain ROI to compare things over the same period, such as this quarter's campaigns. Annualized ROI to compare investments of a year or more held for different lengths of time. IRR when money comes in or goes out at several points along the way. Margin, which divides the gain by revenue instead of cost, answers a different question: how much of each sale you keep.
Result: 0.60676411579 shows as 60.7% with Percent format
0.607, which shows as 60.7%: $105,850 of gain on $174,450 spent.
Common mistakes
Using revenue as the return
ROI needs the gain after the costs of earning it. Use gross profit or savings in the return column, or subtract product costs first. Revenue divided by spend is ROAS, not ROI.
Averaging ROI percentages for a total
Small projects get the same weight as big ones. Divide total gain by total cost: =(SUM(C2:C7)-SUM(B2:B7))/SUM(B2:B7).
Missing brackets: =C2-B2/B2
Excel divides before it subtracts, so you get C2 minus 1. Write =(C2-B2)/B2.
Comparing a 1-year ROI with a 5-year ROI
Annualize both with =(return/cost)^(1/years)-1, or use IRR if the money arrives in stages.
FAQ
What is the formula for ROI in Excel?
=(return-cost)/cost, for example =(C2-B2)/B2, then apply Percent Style. If the return cell already holds the gain, use =gain/cost.
Can ROI be negative?
Yes. If the investment brought back less than it cost, the gain is negative and so is the ROI. -100% means you lost everything you put in.
What is the difference between ROI and profit margin?
ROI divides the gain by what you invested. Margin divides the profit by the selling price. A product with $10 profit on a $40 cost and a $50 price has a 25% ROI on cost but a 20% margin.
How do I calculate monthly ROI as a yearly figure?
Use =(1+monthly ROI)^12-1 if the gain could really be reinvested every month at that rate. For one-off short campaigns that is rarely true, so report the plain ROI with its time period instead.
Why does my ROI show #DIV/0!?
The cost cell is empty or 0. Wrap the formula, =IF(B2=0,"",(C2-B2)/B2), and check whether a cost is really zero or just missing.
Functions used
SUMAdds numbersSORTBYSorts by other columns, spillsHSTACKJoins arrays side by sideIFPicks a result from a testAVERAGEMean of numbers
Related guides
- How to calculate CAGR in Excel
- How to calculate profit margin in Excel
- How to calculate markup in Excel
- How to calculate percent change in Excel
- How to calculate the break-even point in Excel
- Excel formulas cheat sheet: the 25 everyone should know
Updated