What is the formula to calculate the rank of each candidate when I have the total candidates and votes secured by each?
I've managed the percentage part, but calculating the rank has me stuck.
Id be glad if you could help with just the formula. Just like the formula for interest is PTR/100, what would be the formula to calculate this?
Total Candidates
5
Total Votes
75
Votes
Name Votes Percentage Rank(What I'm trying to calculate)
A 25 33.34 1/5 ->Rank 1/5 has the most votes
B 20 26.67 2/5 ->And so on. Never mind the /5 part
C 10 13.34 4/5
D 5 6.67 5/5
E 15 20.00 3/5
SELECT A.*, count(B.*) as Rank FROM mytable as A, mytable as B WHERE A.Votes <= B.Votes