Internal rate of return
Find the discount rate that makes equally spaced annual cash flows have zero net present value.
How this works
Find the annual rate r for which Σ CF_t/(1+r)^t = 0, starting with the cash flow today at t = 0. The code narrows the rate interval by bisection for 150 iterations between −99% and 1,000%. It accepts one negative initial outflow followed by nonnegative annual inflows, including at least one positive inflow.
Example
The illustration may use different inputs from the reproducible default inputs listed below.
For the default series −$10,000, $4,000, $4,000, $4,000, solve the rate that makes the discounted three annual inflows equal the initial $10,000 outflow. With all reset-default inputs, annual irr: 9.701%.
- Initial outflow then annual inflows ($)
- -10000,4000,4000,4000
- Annual IRR
- 9.701%
Scope and assumptions
Cash flows must be equally spaced one year apart, with no later negative flows; this restriction avoids multiple-IRR cases. Irregular dates, reinvestment choices and financing costs are not modeled. Rates outside the supported interval return an error. IRR is not a guaranteed future return or an investment recommendation.
Investor.gov — financial tools and calculators