Olympic Rankings in Excel; Gold, Silver, Bronze
Here’s how to insert Olympic style rankings into Microsoft Excel with Gold, Silver, Bronze and fourth place in names with equal/joint placings noted.
The custom VBA is similar to other ranking functions at Many Ordinal RANK() options in Excel with joint, equal rankings, words and more.
Use this to make the right wording for a published table of results, output to a web page or data source for a Word mail merge (of certificates etc.).
Add this custom function RankOlympic() passing in the ranking, Highest value ranking and how many entries have that ranking.
Function RankOlympic(pNumber As Integer, pTopRank As Integer, pNumEqualRankings As Integer) As String
' Olympic style rankings.
Select Case pNumber
RankOlympic = "Gold"
RankOlympic = "Silver"
RankOlympic = "Bronze"
RankOlympic = "Just missed out"
RankOlympic = "one of the rest"
' For bottom ranked item
If pNumber = pTopRank Then
RankOlympic = "Last of the rest"
' returns a suffix depending on the number of equal rankings.
Select Case pNumEqualRankings
' nothing to do
RankOlympic = RankOlympic & " (joint)"
RankOlympic = RankOlympic & " (equal)"
Office Watch has the latest news and tips about Microsoft Office. Delivered once a week.