Here is a User Defined Function (UDF) that gets the ordinal of a number - an ordinal number is an adjective which describes the numerical position of an object, e.g., first, second, third, etc.
If you have found this file useful then consider donating. Why Donate ?
PublicFunction fnGetOrdinal(cuNumber AsCurrency) AsString '// In common usage, an ordinal number is an adjective which describes the '// numerical position of an object, e.g., first, second, third, etc. '// For +ve & -ve numbers Dim strOut AsString * 2 Dim strDg AsString
'// For WorkSheet Calculation Application.Volatile
If Abs(cuNumber) >= 4 And Abs(cuNumber) <= 20 Or (Abs(cuNumber) Mod 10) = 0 Then strDg = " th" Else strDg = Application.WorksheetFunction.Choose(Abs(cuNumber) Mod 10, _ " st", " nd", " rd", " th", " th", " th", " th", " th", " th") EndIf