Formatting Issues

How to Create a Word Date Field with an Ordinal Day Format

Natalie TaylorNatalie Taylor Nov 4, 2026 869 views

Question details

The user needs to dynamically generate dates with ordinal suffixes (e.g., "22nd of January 2022") rather than standard date formats.

How to Create an Ordinal Date Format in Word Documents
Product
Word
Device & OS
not provided
Scenario
Formatting legal documents that strictly require dates to be written out with ordinal suffixes and specific month/year structures.
Observed behavior
Standard Word date fields do not natively append ordinal suffixes dynamically, requiring workarounds like scripts or nested fields.
Before you start

Before proceeding, ensure your document is saved and that you have enabled the Developer tab and macros if you choose to use the VBA automation method.

Solution 1Recommended

Use a VBA Macro to Format Selected Dates

This method automatically converts any selected standard date into a fully formatted ordinal date, correctly handling exceptions like the 11th, 12th, and 13th.

Since Word does not include a native date field format for ordinals, using a short Visual Basic for Applications (VBA) script is the most reliable way to format dates in legal documents without wrestling with complex field codes.

1
Open the VBA Editor

In your Word document, press Alt + F11 on your keyboard to open the Visual Basic for Applications editor.

2
Insert a New Module

In the left-hand Project pane, right-click 'Normal' (or your document name), then select 'Insert' > 'Module' to create a blank script window.

3
Paste the Macro Code

Copy and paste the following VBA code into the module window: ```vba Sub OrdinalDate() Dim rg As Range Dim dt As Date Dim outStr As String If Not IsDate(Selection.Text) Then MsgBox "Please select a date and try again." Exit Sub End If Set rg = Selection.Range While Not IsNumeric(rg.Characters.Last) rg.MoveEnd wdCharacter, -1 Wend dt = CDate(rg.Text) outStr = Day(dt) Select Case Day(dt) Case 11, 12, 13 outStr = outStr & "th of " Case Else Select Case Right(outStr, 1) Case "1": outStr = outStr & "st of " Case "2": outStr = outStr & "nd of " Case "3": outStr = outStr & "rd of " Case Else: outStr = outStr & "th of " End Select End Select outStr = outStr & MonthName(Month(dt)) & " " & Year(dt) rg.Text = outStr End Sub ```

4
Run the Macro on a Date

Close the VBA editor and return to your document. Highlight a standard date (e.g., "1/22/2022"), then press Alt + F8, select "OrdinalDate", and click "Run" to instantly format it as "22nd of January 2022".

Use a VBA Macro to Format Selected Dates
Accurate Suffix Processing: This script intelligently identifies dates ending in 1, 2, or 3, while correctly overriding the rule for the 11th, 12th, and 13th to maintain legal document accuracy.
Professional Document Formatting Tool

Format Legal Documents Efficiently in WPS Writer

WPS Writer offers comprehensive tools to insert, format, and customize date fields for complex legal documents. With full VBA macro integration, seamless compatibility, and a highly intuitive interface, automating document formatting is fast and hassle-free.

  1. 1. Download and Install: Get WPS Office for free and open WPS Writer on your device.
  2. 2. Open Your Legal Document: Open your existing .docx files directly. WPS Writer perfectly preserves all your original layouts and fields.
  3. 3. Utilize Developer Tools: Navigate to the Developer tab to insert custom date fields or paste the provided VBA macro to instantly apply ordinal date formatting.
100% compatibility with Microsoft Word formatting (.docx)Robust developer tools supporting VBA macros for custom date scriptingLightweight, fast, and completely free to download and use
microsoft office alternative - wps office

Frequently Asked Questions

Why doesn't Word include ordinal dates by default?

Standard date field formats follow common numeric patterns universally required across international standards. Ordinals (like 1st, 2nd, 3rd) are generally considered stylistic phrasing and require custom formulas, field nesting, or VBA scripts to generate dynamically.

Does the custom date field update automatically?

If you build the ordinal date using nested field codes (inserted via Ctrl+F9), it will update automatically when the document is refreshed, opened, or printed. However, if you use the VBA macro on selected plain text, it acts as a one-time conversion and must be run again if the underlying date changes.

Can I format the ordinal suffixes as superscript?

Yes. If you use the VBA macro method, you can add an additional line of code to select only the generated two-letter suffix (such as 'st' or 'th') and apply the superscript font property to that specific range.