Consensus/ranked ordering algorithm
I have both good news, and bad news.  Not only is there a way to do it; there are many candidate ways to do it.  For instance, you could use IRV, Condorcet voting, Borda count, or many other schemes.  See https://en.wikipedia.org/wiki/Ranked_voting and https://en.wikipedia.org/wiki/Social_choice_theory.

Unfortunately, there are also negative results showing that no scheme provides all of the properties that we might desire.   See Arrow's theorem: https://en.wikipedia.org/wiki/Arrow%27s_impossibility_theorem and https://en.wikipedia.org/wiki/Condorcet_paradox.