Sub topic 7
Uneven Cash Flows, NPV and IRR
Assume you know algebra, percentages, exponents, and the time value of money for a single cash flow. You also need to read a cash-flow timeline. In this chapter, a cash flow at time 0 occurs today, while later cash flows occur at the end of each period.
Why uneven cash flows need separate analysis
An annuity has equal payments at regular intervals. Many investments do not. A project might require a large payment today, produce different cash inflows over several years, and then receive a final resale value.
The key rule is to discount every cash flow to the same date. Net present value (NPV) is the sum of those discounted cash flows:
\[ NPV=\sum{t=0}^{n}\frac{CFt}{(1+r)^t} \]
Here, \(CF_t\) is the cash flow at time \(t\), \(r\) is the discount rate per period, and \(n\) is the final period.
A positive NPV means the investment is worth more than its cost when measured at the required return. A negative NPV means it does not meet that return.
| Time | Cash flow | Discount factor at 8% | Present value |
|---|---|---|---|
| 0 | -100 | 1.0000 | -100.00 |
| 1 | 10 | 0.9259 | 9.26 |
| 2 | 20 | 0.8573 | 17.15 |
| 3 | 120 | 0.7938 | 95.26 |
The NPV is approximately $21.67. Because the initial investment is shown as a negative cash flow, it is already included in the sum.
Calculating NPV
For cash flows of \(-100, 10, 20,\) and \(120\), discounted at 8%:
\[ NPV=-100+\frac{10}{1.08}+\frac{20}{1.08^2}+\frac{120}{1.08^3} \]
The timing matters. Do not discount the time-0 cash flow. Also match the rate period to the cash-flow period. If cash flows are annual, use an annual rate. For monthly cash flows, use a monthly rate unless you first convert the rate.
def npv(rate, cash_flows):
return sum(cf / (1 + rate) ** t for t, cf in enumerate(cash_flows))
cash_flows = [-100, 10, 20, 120]
print(round(npv(0.08, cash_flows), 2)) # 21.67IRR and its interpretation
The internal rate of return (IRR) is the discount rate that makes NPV equal to zero:
\[ 0=\sum{t=0}^{n}\frac{CFt}{(1+IRR)^t} \]
IRR is a percentage return implied by the cash-flow pattern. If IRR exceeds the required return, the project has a positive NPV under the usual assumptions.
IRR usually requires trial and error or a calculator function. The code below uses bisection. It narrows the answer between a rate producing positive NPV and one producing negative NPV.
def npv(rate, cash_flows):
return sum(cf / (1 + rate) ** t for t, cf in enumerate(cash_flows))
def irr(cash_flows, low=0.0, high=1.0, tolerance=1e-10):
while high - low > tolerance:
mid = (low + high) / 2
if npv(mid, cash_flows) > 0:
low = mid
else:
high = mid
return (low + high) / 2
flows = [-100, 10, 10, 110]
print(round(irr(flows), 4)) # 0.1000For unusual cash flows with more than one change from negative to positive, multiple IRRs can exist. In that situation, NPV is usually the more reliable decision rule.
Exercise
A project costs 200 today and pays 80 at the end of each of the next three years. At a 10% required return, is its NPV positive or negative?
Show answer
NPV = -200 + 80/1.10 + 80/1.10^2 + 80/1.10^3, which is approximately -1.05. The NPV is negative, so the project does not meet a 10% required return.