Is there an exact way to clone the PERCENTRANK.INC function of Excel in Javascript ? I wrote my own and also tried to use the following libraries - the results don't always match.
https://github.com/formulajs/formulajs
https://github.com/malcolmvr/percentile-rank
FormulaJS comes close to Excel's output but it still has differences. In the table below the 'RAW Data' is the original array, the second column is values which I am trying to compare with the data in the first column using the PERCENTRANK.INC function.
Is there a way to get the exact results as in Excel for this function. I am also sharing my Node code to experiment with the function.
const formularjs = require('@formulajs/formulajs');
let array =[71,13,23,32,45,99,103,71,43,11,91,21,45,45,89,66,41,29,66,63];
let compare_array =[11,19,17,31,32,43,71,63,35,13,73,74,81,100,13,41,31,29,31,33];
compare_array.forEach(function(n){
let pr = formularjs.PERCENTRANKINC(array,n,3);
console.log(pr);
});

