I am thinking if there exists any name for such a simple function which returns the order of numbers in an array. I would really love to do this ranking by minimalist way and with basic Unix commands but I cannot get anything to my mind than basic find-and-loop which is not so elegant. Assume you have an array of numbers
17
94
3
52
4
4
9
Expected output where duplicates just receive the same ID; how to handle duplicates is not critical so feel to take shortcuts:
4
6
1
5
2
2
3
Motivation: I saw today many users using many different ways to solve this problem and doing much manual steps with Spreadsheet; so I started to think the minimalist way to do it.
Comparing the ranking algorithm to Google's Average ranking
In Google Spreadsheet, do =arrayformula(rank.AVG(A:A,A:A,true))
and you get as a benchmark as ascending order like the first expected output
17 5
94 7
3 1
52 6
4 2.5
4 2.5
9 4
where you see that my initial ranking algorithm is biased. I think to be able to set the dataset location would be helpful here.