[ See also Net Present Value @ Wikipedia ]
NPV = \sum_{t=0}^n \frac{R_t}{(1+r)^t} = R_0 + \sum_{t=1}^N \frac{R_t}{(1+r)^t} |
where
t – time moment since the first investment,
r = \rm \frac{Cash_{out} - Cash_{in}}{Cash_{in}} – the discount rate, i.e. the return that could be earned per unit of time on an investment with similar risk
n – total number of time steps
R_t = \rm Cash_{in}(t) - \rm Cash_{out}(t) – the net cash flow at time step t.
R_0 = - \rm Cash_{out}(t=0) – the initial investment at time step t = 0.