Wolfram Alpha:

```NPV and IRR
-----------
n
NPV(i,n) = -R0 + Σ{Rt/(1 + i)t}
t=1

i = Discount rate (rate of return that could be earned on an
investment in the financial market with similar risk).
Also known as IRR or Hurdle rate.
R0 = Initial investment, t = 0
Rt = Net cash flow at time, t
n = Number of periods.

A firm's weighted average cost of capital (after tax) is often
used for i, but many people believe that it is appropriate to
use higher discount rates to adjust for risk or other factors.
A variable discount rate with higher rates applied to cash flows
occurring further along the time span might be used to reflect
the yield curve premium for long-term debt.

The net cash flow can be computed as:

Rt = NET PROFIT + DEPRECIATION

or an equivalent form such as

Rt = REVENUE - CASH EXPENSES - TAXES etc.

NPV > 0 - the investment would add value to the firm
NPV < 0 - the investment would subtract value from the firm
NPV = 0 - the investment would be neutral to the firm.  This is
the breakeven point.

NPV of Uneven Cash Flow
-----------------------

PV of CF for single period = CF/(1 + i)n

i = interest for the period
n = period number

For example, i = 11% = 0.11 for period n = 5 and CF = 500.
Therefore,

PV5 = CF5 /(1 + i)5

To get the total PV just add the individual periods

Mathematically, this is represented as:

N
Σ{CFn/(1 + i)n}
n=0```