How to calculate NPV in Excel: the NPV function, the year-zero mistake and IRR
Calculate a project’s NPV (net present value) in Excel: discounting logic, the year-zero mistake in the NPV function, the blank-cell trap, IRR, XNPV and a rate sensitivity table.
A bakery owner wants to buy a new oven for 60 million soums. By his estimate it will bring an extra 15, 18, 20, 22 and 25 million in net cash over 5 years — 100 million in total. “40 million profit” — worth it, right? But 60 million today and 25 million five years from now are not the same money: today’s money put in a bank at 14% grows too.
NPV (net present value) brings every future cash flow back to today’s value and subtracts the investment. The rule is simple: NPV > 0 — the project earns more than the required return; NPV < 0 — the money is better invested elsewhere.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Year | Cash flow | Rate | 14% | ||
| 2 | 0 | -60 000 000 | ||||
| 3 | 1 | 15 000 000 | ||||
| 4 | 2 | 18 000 000 | ||||
| 5 | 3 | 20 000 000 | ||||
| 6 | 4 | 22 000 000 | ||||
| 7 | 5 | 25 000 000 | ||||
| 8 | NPV | 6 517 723 | ||||
| 9 |
The logic: discounting by hand
1
For each year, the discount factor: =1/(1+$F$1)^A2. It is 1 in year 0, 0.877 in year 1 and 0.519 in year 5 — 1 soum five years from now is worth only 0.52 soum today.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Year | Cash flow | Factor | Present value | Rate | 14% | |
| 2 | 0 | -60 000 000 | 1,0000 | -60 000 000 | |||
| 3 | 1 | 15 000 000 | 0,8772 | 13 157 895 | |||
| 4 | 2 | 18 000 000 | 0,7695 | 13 850 416 | |||
| 5 | 3 | 20 000 000 | 0,6750 | 13 499 430 | |||
| 6 | 4 | 22 000 000 | 0,5921 | 13 025 766 | |||
| 7 | 5 | 25 000 000 | 0,5194 | 12 984 217 | |||
| 8 | Total | 40 000 000 | 6 517 723 | ||||
| 9 |
2
Present value = cash flow × factor (=B2*C2). Their sum is the NPV. This table shows what happens inside the NPV function and is very handy for checking your result.
The NPV function — written correctly
1
Syntax: NPV(rate, value1, [value2], …). The key point: NPV assumes the first value arrives at the end of year 1 and discounts it too.
2
So don’t put the year-0 investment inside NPV — add it outside: =ЧПС(E1;B3:B7)+B2. B3:B7 are years 1–5, B2 is today’s (negative) investment.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Year | Cash flow | Rate | 14% | ||
| 2 | 0 | -60 000 0001 | ||||
| 3 | 1 | 15 000 000 | ||||
| 4 | 2 | 18 000 000 | ||||
| 5 | 3 | 20 000 000 | ||||
| 6 | 4 | 22 000 000 | ||||
| 7 | 5 | 25 000 000 | ||||
| 8 | NPV | 6 517 7232 | ||||
| 9 |
3
Don’t hard-code the rate — keep it in a cell (E1) in percent format: 14%. Then change it to see quickly at what rate the project starts losing money.
IRR — the highest rate the project can “bear”
1
=ВСД(B2:B7) is the rate at which NPV is exactly 0. Here the investment goes inside the range (IRR takes all flows starting from year 0). The result is ≈ 18.1%.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Year | Cash flow | IRR | 18,1% | ||
| 2 | 0 | -60 000 000 | NPV at IRR | 0 | ||
| 3 | 1 | 15 000 000 | ||||
| 4 | 2 | 18 000 000 | ||||
| 5 | 3 | 20 000 000 | ||||
| 6 | 4 | 22 000 000 | ||||
| 7 | 5 | 25 000 000 | ||||
| 8 |
2
Decision rule: accept the project if IRR > the required rate. Here 18.1% > 14% — the oven pays off. With a 20% loan, it doesn’t.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Year | Cash flow | Rate | 14% | ||
| 2 | 0 | -60 000 000 | ||||
| 3 | 1 | 15 000 000 | Correct | 6 517 723 | ||
| 4 | 2 | 18 000 000 | Wrong | 5 717 3011 | ||
| 5 | 3 | 20 000 000 | Difference | 800 422 | ||
| 6 | 4 | 22 000 000 | ||||
| 7 | 5 | 25 000 000 | ||||
| 8 |
Pro level: sensitivity, XNPV and the profitability index
- Rate sensitivity. A single NPV says little — calculate it at several rates. Put 12%, 14%, 18%, 20% in a column with
=ЧПС(A2;$B$…)+…next to them and you’ll see where NPV turns negative (table below). In Excel you can automate this with What-If Analysis → Data Table. - Irregular dates — XNPV. If payments happen on specific dates rather than at year-end:
=XNPV(rate;B2:B7;C2:C7), where C holds the dates. XNPV doesn’t discount the first flow, so the investment can stay inside the range. Its partner isXIRR. - Profitability index (PI):
=ЧПС(E1;B3:B7)/-B2≈ 1.11 — every soum invested returns 1.11 soums of present value. Fairer than NPV when choosing between projects of different size. - Payback period: the year in which the running total (
=СУММ($B$2:B2)) turns positive. For the discounted version, take a running total of the present values in column D.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Rate | NPV | ||
| 2 | 12% | 10 145 021 | ||
| 3 | 14% | 6 517 723 | ||
| 4 | 18% | 86 887 | ||
| 5 | 20% | -2 769 419 | ||
| 6 | 24% | -7 873 812 | ||
| 7 |
Try it in the simulator
Type =ЧПС(B1;B4:B8)+B3 in B9 — NPV ≈ 6,517,723. Type =ВСД(B3:B8) in B10. Then change the rate in B1 to 0.2 and see NPV turn negative. Bonus: type the wrong version =ЧПС(B1;B3:B8) in B11 and compare.
| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Rate | 0,14 | ||||||||||||||||||||||
| 2 | Year | Cash flow | ||||||||||||||||||||||
| 3 | 0 | -60000000 | ||||||||||||||||||||||
| 4 | 1 | 15000000 | ||||||||||||||||||||||
| 5 | 2 | 18000000 | ||||||||||||||||||||||
| 6 | 3 | 20000000 | ||||||||||||||||||||||
| 7 | 4 | 22000000 | ||||||||||||||||||||||
| 8 | 5 | 25000000 | ||||||||||||||||||||||
| 9 | NPV | |||||||||||||||||||||||
| 10 | IRR | |||||||||||||||||||||||
| 11 | Wrong NPV | |||||||||||||||||||||||
| 12 | ||||||||||||||||||||||||
| 13 | ||||||||||||||||||||||||
| 14 | ||||||||||||||||||||||||
| 15 |
Has ExcelLab been useful?
Support the project and help us release new lessons and exercises.