You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
XIRR value is being calculated incorrectly for transactions of order 40k-50k, the incorrectness increases when the number of transactions increase say 80k-90k
This I had checked with other xirr packages which were returning the same value as well as Excel, which confirmed the calculations. The value calculated by this package was incorrect
The text was updated successfully, but these errors were encountered:
const Finance = require('financejs');
var finance = new Finance();
var start = new Date(Date.parse("2013-12-31"));
var end = new Date(Date.parse("2014-05-15"));
var irr = finance.XIRR([-37987348, 21191041], [start, end], 0);
console.log(irr); //will not calculate
However, if you (somehow) correctly guess the initial guess close to the result, it will work.
var irr = finance.XIRR([-37987348, 21191041], [start, end], -0.8);
console.log(irr); //-79.36
Nice find on the guess value part that you mentioned, but yeah it does pose the difficulty of correctly assuming an initial close value.
I have kept the usage of this package limited to any fallback calls(if others fail), and have shifted my primary package to webcarrot/xirr, which is based on the XIRR function call from the LibreOffice Software
Since it is closely associated with the MS Office Excel etc., softwares, it correctly calculates values for 99.9% of the use cases, for others, there's usually a problem with improper set of transactions, else, I use fallback calls to this and other XIRR packages to get a value. But mostly those are very corner cases
XIRR value is being calculated incorrectly for transactions of order 40k-50k, the incorrectness increases when the number of transactions increase say 80k-90k
This I had checked with other xirr packages which were returning the same value as well as Excel, which confirmed the calculations. The value calculated by this package was incorrect
The text was updated successfully, but these errors were encountered: