Question Ranking

Simply Me

Member
Joined
Nov 3, 2012
Messages
17
Programming Experience
Beginner
Hi!

Just like to ask if anyone here has come across with the equivalent of the new Excel 2012 RANK.AVG function in VB2005 or any equivalent if there's any?

Many Thanks!
 
Have you tried to replicate it manually? Send you values to a list, sort the list, find your number, get the rank (index of number +1), repeat until the next index does not equal your number, divide total of ranks by total occurrences of your number.
 
It's actually a bit easier than that even. You can use IndexOf and LastIndexOf to get the indexes of the first and last occurrence in a sorted list. Increment each to get the first and last rank and then a bit of simple maths to get the average of that range.
 
Back
Top