Created attachment 30985 [details] patch Attached is an implementation of Excel PERCENTILE function. This is my first ever submission to the Apache POI project, so please advise me if I have done anything wrong.
Thanks for this! Any chance you could work up a unit test for the function? That will let us check that it's working right now, and also ensure it doesn't get broken in future Also, if possible, and update to the overall formula evaluation checking tests in FormulaEvalTestData would be great. Bug #54469 has quite a bit on that in it, if you want to see how people have helped with that in the past
When you say unit test do you mean to write \testcases\org\apache\poi\ss\formula\functions\TestPercentile.java? And do you mean to update the Excel FormulaEvalTestData.xls? Where is the latest version I can download?
Thanks for your contribution! I did: 1. Just add a missing error handling in percentile: if array is empty or contains more than 8,191 data points, PERCENTILE returns the #NUM! error value. 2. Added tests in overall formula evaluation checking in FormulaEvalTestData.xls. I found no differences between your code and excel evaluation of PERCENTILE. But please provide a unit test TestPercentile.java so i can close the issue revision 1539154
Created attachment 31017 [details] Testcase for Percentile
Thank you Cédric for your fixing and comments on my code. (I did not think of looking up the official Excel documentation - thank you, and I know for next time.) Please see test case as requested.
Thanks you, your unit has been merged in revision 1539401 to trunk