Olympic Rankings in Excel; Gold, Silver, Bronze


Office for Mere Mortals
Your beginners guide to the secrets of Microsoft Office
Invalid email address
Tips and help for Word, Excel, PowerPoint and Outlook from Microsoft Office experts.  Give it a try. You can unsubscribe at any time.  Office for Mere Mortals has been running for over 20 years, we've never, ever revealed or sold subscriber details.  Privacy policy

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.

olympic rankings in excel gold silver bronze 16695 - Olympic Rankings in Excel; Gold, Silver, Bronze

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.

olympic rankings in excel gold silver bronze microsoft excel 16697 - Olympic Rankings in Excel; Gold, Silver, Bronze

Function RankOlympic(pNumber As Integer, pTopRank As Integer, pNumEqualRankings As Integer) As String

' Office-Watch.com
' Olympic style rankings.

Select Case pNumber

    Case 1
   RankOlympic = "Gold"

    Case 2
    RankOlympic = "Silver"

    Case 3
    RankOlympic = "Bronze"

    Case 4
    RankOlympic = "Just missed out"

    Case Else
    RankOlympic = "one of the rest"

End Select

' For bottom ranked item
If pNumber = pTopRank Then
    RankOlympic = "Last of the rest"
End If

' returns a suffix depending on the number of equal rankings.
Select Case pNumEqualRankings

    Case 1
  ' nothing to do

    Case 2
    RankOlympic = RankOlympic & " (joint)"

    Case Else
    RankOlympic = RankOlympic & " (equal)"

End Select
End Function

subs profile e1563205311409 - Olympic Rankings in Excel; Gold, Silver, Bronze
Latest news & secrets of Microsoft Office

Microsoft Office experts give you tips and help for Word, Excel, PowerPoint and Outlook.

Give it a try. You can unsubscribe at any time.  Office Watch has been running for over 20 years, we've never, ever revealed or sold subscriber details.  Privacy policy
Invalid email address