The firm opens soon. Guides and calculators are already free to use —get notified when we open
Finance basics

NPV, IRR and payback period: choosing an investment with worked calculations

Appraising an investment: cash flows, discounting, net present value (NPV), IRR and payback period. Complete calculation and Excel formulas.

Published 9 min readLevel: IntermediateEl Arabi Aich

In brief
  • An investment is assessed on the cash flows it generates, discounted at the cost of capital, not on accounting profit.
  • NPV = sum of discounted cash flows − initial investment; it is positive if the project creates value at the chosen discount rate.
  • IRR is the discount rate that makes NPV equal to zero; it is compared against the cost of capital or required rate of return.
  • Payback period shows how many years it takes to recover the initial outlay, but ignores later cash flows and the time value of money (unless discounted).

Buying a machine, opening a retail outlet, developing software: every investment commits money today in exchange for future returns. How do you know whether it is worthwhile? Three tools answer that question: net present value (NPV), internal rate of return (IRR) and payback period.

The principle: one dirham tomorrow is worth less than one dirham today

One dirham received in a year’s time is not worth one dirham today: it could have been invested, or used to avoid borrowing. Future cash flows are therefore discounted:

Present value of a cash flow F received in t years at rate i = F ÷ (1 + i)^t

Step 1: determine the cash flows

For each year, net cash flow = after-tax gross operating surplus (EBE) + tax shield on depreciation − change in working capital requirement (WCR) − replacement investments. A simple approach: cash flow = net profit + depreciation charges − change in WCR (a form of self-financing capacity [CAF] adjusted for WCR).

Worked case: the production line

An SME is considering buying a production line for MAD 1,000,000, with a 5-year useful life and zero residual value. Forecast net cash flows (after tax):

Year Cash flow (MAD)
0 −1,000,000
1 250,000
2 300,000
3 350,000
4 350,000
5 300,000

Chosen discount rate: 10%.

Net present value (NPV)

Year Cash flow Factor 1/(1.10)^t Discounted cash flow
0 −1,000,000 1.0000 −1,000,000
1 250,000 0.9091 227,273
2 300,000 0.8264 247,934
3 350,000 0.7513 262,960
4 350,000 0.6830 239,055
5 300,000 0.6209 186,276
NPV 163,498

NPV is positive (MAD 163,498): at a 10% rate, the project creates value. Decision rule: NPV > 0 → accept; NPV < 0 → reject.

Excel formula: =NPV(10%,B2:B6)+B1 where B1 holds the initial investment (negative) and B2:B6 hold the annual cash flows. Note: Excel’s NPV function discounts the first cash flow at the end of the first period, which is why B1 is added outside the function.

Internal rate of return (IRR)

IRR is the discount rate that brings NPV to zero. By trial and error:

Rate NPV (MAD)
10% 163,498
15% 23,632
16% −1,168
15.96% ≈ 0

The IRR is roughly 16%. Because it exceeds the 10% hurdle rate, the project is viable. Excel formula: =IRR(A1:A6) (the full series of cash flows, from the negative initial outflow to the positive inflows).

Payback period

Cumulative cash flows (undiscounted):

Year Cash flow Cumulative
0 −1,000,000 −1,000,000
1 250,000 −750,000
2 300,000 −450,000
3 350,000 −100,000
4 350,000 +250,000

The cumulative balance turns positive in year 4: (100,000 ÷ 350,000) = 0.29 years after the end of year 3. Payback period ≈ 3.3 years. Discounted version: accumulate discounted cash flows instead; the discounted payback period is then roughly 4.1 years.

Advantage: straightforward, intuitive for business owners and bankers. Limitations: ignores what happens after payback and treats a dirham in year 1 the same as a dirham in year 3 (in the undiscounted version).

Comparing multiple projects

Project B below is hypothetical (its underlying cash flows are not detailed): it serves to illustrate the ranking method.

Criterion Project A (production line above) Project B
Investment 1,000,000 500,000
NPV at 10% 163,498 110,000
IRR 16.0% 22%
Profitability index (NPV ÷ investment) 0.16 0.22
Payback period 3.3 years 2.5 years

If the business can finance both projects, it undertakes both (positive NPVs). If capital is constrained, it ranks by profitability index: B first. If the projects are mutually exclusive, the higher NPV generally wins (A), provided the underlying assumptions are solid.

Assumptions to stress-test

  1. Revenue: does a −10% drop turn NPV negative?
  2. Costs: a 5% rise in variable costs.
  3. Start-up delay of six months.
  4. Discount rate: ranging from 8% to 14%.
  5. Residual value and working capital requirement.

A sensitivity analysis establishes the break-even threshold: for instance, “the project remains viable as long as revenue does not fall by more than 12%”.

Testing sensitivity: rate, cash flows and duration

A positive NPV is only meaningful if it holds up under slightly less favourable assumptions. For the production line project (investment of MAD 1,000,000, cash flows of 250, 300, 350, 350 and 300 thousand MAD):

Sensitivity to the discount rate

Rate NPV (MAD) Decision
8% 227,960 Accept
10% 163,498 Accept
12% 104,155 Accept
14% 49,417 Accept
16% −1,168 Reject (IRR is 15.95%)

The project remains viable as long as the cost of capital does not exceed 15.95%. The profitability index ((NPV + investment) ÷ investment) is (163,498 + 1,000,000) ÷ 1,000,000 = 1.16 at 10%: every dirham invested returns 1.16 in present value.

Sensitivity to cash flows

What happens if annual cash flows turn out 10% or 20% below forecast (slower market take-up, price pressure)?

Scenario NPV at 10% (MAD) IRR
Forecast cash flows 163,498 15.95%
Cash flows −10% 47,148 11.76%
Cash flows −20% −69,202 7.35%

The project withstands a 10% drop in cash flows, but becomes unprofitable at −20%: the margin of safety is narrow. A fall of roughly 14% reduces NPV to zero. This reading is more informative than NPV alone: it shows how far commercial assumptions can be off before the decision reverses.

Questions to ask alongside the numbers

  1. Where do the cash flows come from? Signed contracts, order book, or simple growth optimism?
  2. What is the machine’s real useful life? A project that only pays off after year five carries higher risk.
  3. What working capital requirement does the project generate? It must be added to the initial investment in the cash flows (see the article on WCR).
  4. How is it financed? A positive NPV does not mean the company has the liquidity to execute it (see SME financing).
  5. What happens if it fails? Resale value and exit costs form part of the risk.

Two competing projects: when NPV and IRR rank differently

A company has budget for only one of the following two projects (10% discount rate):

Project A (production line) Project B (smaller-scale equipment)
Investment 1,000,000 500,000
Annual cash flows (5 years) 250,000; 300,000; 350,000; 350,000; 300,000 160,000 per year
NPV at 10% 163,498 106,526
IRR 15.95% 18.03%
Profitability index 1.16 1.21

NPV ranks A first; IRR and the profitability index rank B first. Two methods help decide:

  1. Absolute NPV: A creates more value (163,498 versus 106,526), but ties up twice as much capital. If the budget is not constrained and the other half of the funds has no higher-yielding use, A is preferable.
  2. Incremental analysis: examine the “A minus B” project, i.e. the extra MAD 500,000 investment required to move from B to A. Its cash flows: 90,000; 140,000; 190,000; 190,000; 140,000. Its NPV at 10% is MAD 56,972 and its IRR is 14.0%. As long as the cost of capital remains below 14%, the incremental outlay is worthwhile and A wins; above 14%, B becomes preferable.
Discount rate NPV of A NPV of B Better project
5% 335,551 192,716 A
8% 227,960 138,834 A
10% 163,498 106,526 A
12% 104,155 76,764 A
15% 23,632 36,345 B
18% −48,001 347 B

The ranking therefore depends on the discount rate. For a company with a 10% cost of capital, A is the better choice; for a highly leveraged business whose cost of capital is close to 15%, B is safer. The decision also weighs risk and funding capacity.

Moving from accounting profit to cash flows

NPV applies to after-tax cash flows, not accounting profit. Take a capital project of MAD 1,000,000, depreciated straight-line over 5 years (200,000 per year), generating MAD 400,000 of additional annual gross operating surplus. The project requires MAD 100,000 of working capital (WCR), recovered at the end. Corporate income tax (IS) rate of 20%.

Line item (annual) Calculation Amount (MAD)
Additional gross operating surplus 400,000
Depreciation −200,000
Profit before tax 200,000
Corporate income tax (IS) at 20% −40,000
Net profit 160,000
+ Depreciation (non-cash) + 200,000
Annual cash flow 360,000
Year Cash flow
0 −1,100,000 (investment + WCR)
1 to 4 360,000
5 360,000 + 100,000 (WCR recovery) = 460,000

NPV at 10%: MAD 326,775, IRR: 20.7%. Without the depreciation tax shield, the annual cash flow would be 320,000; the 360,000 figure reflects the depreciation tax shield (200,000 × 20% = 40,000). A common mistake is to calculate NPV on gross operating surplus before tax and WCR: that would give an NPV of MAD 516,315, overstating value by more than MAD 190,000.

Modelling pitfalls

Pitfall Consequence Remedy
Omitting WCR Overstated NPV Include initial WCR and recover it at project end
Omitting residual value Understated NPV Estimate resale or trade-in value
Ignoring tax Overstated cash flows Calculate corporate income tax and the depreciation shield
Including finance charges in cash flows Double-counting with the discount rate Exclude them: financing cost is already in the discount rate
Using too low a discount rate Poor projects accepted Use risk-adjusted cost of capital
Projecting optimistic growth Overly favourable NPV Run conservative, base and optimistic scenarios
Neglecting inflation Mismatched cash flows and rate Keep both cash flows and discount rate nominal, or both real

Choosing the discount rate

The discount rate reflects what the capital employed could earn elsewhere, plus a risk premium. A straightforward approach for an SME:

Component Example
After-tax cost of debt 7% × (1 − 20%) = 5.6%
Return required by shareholders 12%
Weighting (40% debt, 60% equity) 0.4 × 5.6% + 0.6 × 12% = 9.4%
Project risk premium (new market) + 2 percentage points
Chosen discount rate ≈ 11.4%

The result approximates the weighted average cost of capital; management selects a higher rate for a risky project and a lower rate for a safe one. What matters most is documenting the assumption and testing the decision across several rates, as in the comparison table above.

Pitfalls

  • Basing decisions on accounting profit rather than cash flows.
  • Forgetting the working capital requirement generated by growth.
  • Using too low a rate for a high-risk project.
  • Ignoring replacement capital expenditure during the project’s life.
  • Overestimating distant cash flows.
  • Overlooking taxation (accelerated depreciation, tax losses, incentives) that alters cash flows.

Frequently asked questions

Which discount rate should be used?

The company’s weighted average cost of capital (WACC), plus a risk premium specific to the project. For a Moroccan SME, practitioners often use the cost of bank borrowing plus a premium, or the return required by shareholders (10% to 15% depending on risk, adjusted as appropriate).

Positive NPV and IRR above the hurdle rate: are all projects equal?

No: among positive-NPV projects, rank by NPV (absolute value creation) when capital is available, and by profitability index (NPV ÷ investment) when capital is rationed.

Can a project have multiple IRRs?

Yes, if cash flows change sign more than once (initial outlay, inflows, then decommissioning costs). In that case, NPV is the reliable criterion.

Do cash flows include tax and working capital?

Yes: work with cash flows after corporate income tax, adding back depreciation (non-cash) and deducting changes in working capital requirement as well as replacement capital expenditure.

El Arabi Aich

Article written from the official texts and the firm’s engagement practice. It shows its publication date and, where applicable, its last review.

Related articles

A question about your situation?

Tell us about your project: we reply within 48 business hours with a draft engagement letter.