I\'m using a IRR function in javascript to create calculation a that is done in excel using its own IRR function. The problem is mine is little off and I have no idea why. Here\
We modified the code to achieve performance and accuracy. Try this:
function IRRCalc(CArray) { min = 0.0; max = 1.0; do { guest = (min + max) / 2; NPV = 0; for (var j=0; j 0) { min = guest; } else { max = guest; } } while(Math.abs(NPV) > 0.000001); return guest * 100; }