Recently, I was helping a bank define Basel 2 requirements.
For every dollar a bank lends, at least 8 cents should come from its own pocket, and the rest from its depositors. But a risky $1 loan may be like a $1.5 loan, whereas a $1 Government loan may be like a $0.5 loan. This is the "risk-weighted asset" (RWA) value. Basel 2 says 8% of risk-weighted assets should come from the bank's pocket.
I was trying to convince the people who were maintaining the leasing software that the RWA of a lease is the NPV of its future cash flows, and they had a whole lot of questions.
And we got stuck here, because their software didn't have an IRR function, and the definitions for IRR and NPV are circular.
To do this in Excel is simple. Just enter the cash flow values. So, if on a loan of $500, you paid $100 for 6 months, and use the IRR function, as shown below. Your monthly IRR is 5.47%.
But we needed their AS/400 system to do it as well, and it didn't have the IRR function.
After a few weeks of digging around, I found a paper that said you can calculate the IRR iteratively. Let
Then irr = irr * log(p/sum) / log(npv/sum) is the iteration you need to successively apply.
We decided to start with 1.85 times the stated interest rate (which was a pretty good guess for most leases), and kept applying this formula until it stays more or less the same. Worked like a charm.
Here's the spreadsheet with the calculation.