Format cells to display ordinal numbers ex 21st

G

Guest

I would like to format numbers so that they appear as ordinals

ex
1 1st
2 2nd
3 3rd
4 4th
etc.
 
B

Biff

You need to use a helper cell with a formula or a VBA procedure.

Here's a formula:

A1 = 301

=A1&IF(OR(MOD(A1,100)={11,12,13}),"th",LOOKUP(--RIGHT(A1),{0,"th";1,"st";2,"nd";3,"rd";4,"th"}))

Returns: 301st

Biff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top