Function OrdinalDateSuffix(datein As variant) As String
Dim tmp As String
tmp = Format(datein, "d")
Dim ordinal As string
Select Case tmp
Case "1" : ordinal = "st"
Case "2" : ordinal = "nd"
Case "3" : ordinal = "rd"
Case "21" : ordinal = "st"
Case "22" : ordinal = "nd"
Case "23" : ordinal = "rd"
Case "31" : ordinal = "st"
Case Else : ordinal = "th"
End Select
'output
OrdinalDateSuffix = "<sup>" & ordinal & "</sup>"
End Function