If I populate some cells on an Excel spreadsheet with, say, 1, 2, 3, 4; and then
set another cell to =Percentile([cell range], .9) I get a result of 4.
OTOH, if I'm in VBA and feed the those numbers to
gExcelApp.WorksheetFunction.PercentRank, I get 3.7.
Only diff I can see is the use of a VBA array of double to pass the numbers 1-4.
If I populate some cells on an Excel spreadsheet with, say, 1, 2, 3, 4; and then
set another cell to =Percentile([cell range], .9) I get a result of 4.
OTOH, if I'm in VBA and feed the those numbers to
gExcelApp.WorksheetFunction.PercentRank, I get 3.7.
Only diff I can see is the use of a VBA array of double to pass the numbers 1-4.
But I had it backwards. It was the VBA that was goofey. Turns out that when
I passed the K factor parm to my routine I was using a Long field instead of a
double. Therefore .9 became 1.... causing Excel.Percentile to return 4
instead of 3.7.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.