ORDINAL

=ORDINAL(number)

number
a cell or range of cells containing integers

Return the ordinal for a given number

lrobbo314

Well-known Member
Joined
Jul 14, 2008
Messages
3,957
Office Version
  1. 365
Platform
  1. Windows
ORDINAL returns the ordinal for a given number. e.g.

1 -> 1st
2 -> 2nd
etc.

ORDINAL
ABCDEFGHIJ
11st2nd3rd4th5th6th7th8th9th10th
211th12th13th14th15th16th17th18th19th20th
321st22nd23rd24th25th26th27th28th29th30th
431st32nd33rd34th35th36th37th38th39th40th
541st42nd43rd44th45th46th47th48th49th50th
651st52nd53rd54th55th56th57th58th59th60th
761st62nd63rd64th65th66th67th68th69th70th
871st72nd73rd74th75th76th77th78th79th80th
981st82nd83rd84th85th86th87th88th89th90th
1091st92nd93rd94th95th96th97th98th99th100th
11
12Not an integer
13#N/A
Sheet6
Cell Formulas
RangeFormula
A1:J10A1=ORDINAL(SEQUENCE(10,10))
A13A13=ORDINAL(1.5)
Dynamic array formulas.


Excel Formula:
=LAMBDA(number,
    IF(number-INT(number)<>0,
        "#N/A",
        MAP(number,
            LAMBDA(n,
                LET(x,
                    INT(RIGHT(n,2)),
                        n & IF(OR(x=11,x=12,x=13),"th",IFERROR(CHOOSE(RIGHT(x),"st","nd","rd"),"th"))
                )
            )
        )
    )
)
 
Upvote 0

Forum statistics

Threads
1,223,575
Messages
6,173,148
Members
452,502
Latest member
PQCurious

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top