Sort one column to display another

I have two columns, name and rank. I want to sort by rank but display a list of names in list viewer. Is there a way to do that?

You might be able find this useful if you can adapt your lists to this format in this sorting solution