Seeking simple code to rank a series of stats

I asked a similar question a few weeks ago. Still haven’t solved the problem of ties, though.