excel vba get ordinal number from cardinal number

The solution for “excel vba get ordinal number from cardinal number” can be found here. The following code will assist you in solving the problem.

Function Ordinal(n)
Ordinal = n & Evaluate(“IF(OR(–RIGHT(” & n & “,2)={11,12,13}),””th””,IFERROR(CHOOSE(RIGHT(” & n & “),””st””,””nd””,””rd””),””th””))”)
End Function

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

Similar Posts