How to convert date to ordinal date format in Excel?

Convert date to ordinal date format with formula
Convert date to ordinal date format with Defined Function
Convert date to ordinal date format with Kutools for Excel
Convert cardinal number to ordinal number with Kutools for Excel

Convert date to ordinal date format with formula
Here is a formula can help you convert date to ordinal.
Select a blank cell next to the date you want to convert to ordinal date format, C2 for instance, and enter this formula
=DAY(A2)&IF(OR(DAY(A2)={1,2,3,21,22,23,31}),CHOOSE(1*RIGHT(DAY(A2),1),"st","nd ","rd "),"th")&TEXT(A2,"mmmm, yyyy")
and then press Enter key, and drag the autofill handle over the cells you want to convert date to ordinal. See screenshot:
Now the dates have been converted to ordinal dates.
Note: In the formula, A2 is the date you want to convert to ordinal date, you can change it as you need.
Convert date to ordinal date format with Defined Function
Moreover, you also can apply Defined Function to convert standard date to ordinal date.
1. Press Alt + F11 keys to open Microsoft Visual Basic for Applications window.
2. Click Insert > Module, and paste below code to the script.
Code: Convert date to ordinal
Function OrdinalDate(xDate As Date)
'UpdatebyExtendoffice20160705
Dim xDay As Integer
Dim xDayTxt As String
Dim xMonth As Integer
Dim xMonTxt As String
Dim xYear As Long
xDay = Day(xDate)
xMonth = Month(xDate)
xYear = Year(xDate)
Select Case xDay
Case 1: xDayTxt = "st"
Case 2: xDayTxt = "nd"
Case 3: xDayTxt = "rd"
Case 21: xDayTxt = "st"
Case 22: xDayTxt = "nd"
Case 23: xDayTxt = "rd"
Case 31: xDayTxt = "st"
Case Else: xDayTxt = "th"
End Select
xMonTxt = Switch(xMonth = 1, " January", _
xMonth = 2, " February", _
xMonth = 3, " March", _
xMonth = 4, " April", _
xMonth = 5, " May", _
xMonth = 6, " June", _
xMonth = 7, " July", _
xMonth = 8, " August", _
xMonth = 9, " September", _
xMonth = 10, " October", _
xMonth = 11, " November", _
xMonth = 12, " December")
OrdinalDate = xDay & xDayTxt & xMonTxt & " " & xYear
End Function
3. Save the code and close the VBA window, go back to select a cell which will place the converted date, and enter this formula =OrdinalDate(J2), press Enter key, then drag fill handle overt the cells you need. See screenshot:
Tip: in the formula, J2 is the date you want to convert to ordinal date, you can change as you need.
Convert date to ordinal date format with Kutools for Excel
Kutools for Excel, with more than 300 handy functions, makes your jobs more easier. |
After free installing Kutools for Excel, please do as below:
In Kutools For Excel’s Formula Helper tool, you can use the Convert date to ordinal date feature to quickly change Excel date to ordinal.
1. Select a cell that used to place the ordinal date, click Kutools > Formula Helper > Date & Time > Convert date to ordinal date.
2. In the Formulas Helper dialog, choose or type the cell reference into Date section, in default, the cell reference is absolute, please change it to relative if you want to auto fill the formula to other cells by using auto fill handle.
3. Click Ok. Now the date has been changed to ordinal date. Select the result cell and drag auto fill handle over the cells to apply this formula.
Convert cardinal number to ordinal number with Kutools for Excel
In most of cases, you may want to convert numbers to ordinal numbers when you are ranking. In Excel, there is no built-in function can handle, but if you have Kutools for Excel – a handy add in tool, its Convert Number to Ordinal utility can do a favor for you.
Select the numbers you want to convert to ordinal, and click Kutools > Content > Convert Number to Ordinal. See screenshot:
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
