Calculates the internal rate of return of a series of cash flows.
payment is a range containing the payments made or received, at regular intervals.
guess (optional, defaults to 10%) is a first guess at the rate.
IRR iterates to find the rate of return which gives a zero net present value for the cash flows. At least one of the cash flows must be negative and at least one positive - to allow the net present value to be zero. The rate of return is per period, and interest is compounded each period.
The payments are assumed to arise at the start of each period; the order in which the payments are given is important.
where A1:A4 contain -5000, 1000, 2000, 3000, returns approximately 8.21%.