Skip to main content

How to Quickly convert date to words in Excel?

In general, we usually convert the date to other date formats or digits in Excel, but have you ever encountered a problem about converting the date to English words as below screenshot shown? Actually, there is no built-in function that can handle it but a VBA code.
doc date to words 1

Convert date to word with Defined Function


Convert date to word with Defined Function

Here is a macro code that can do you a favor on converting dates to words.

1. Enable the sheet you use and press Alt + F11 keys to open Microsoft Visual Basic for Applications window.

2. Click Insert > Module and paste below code to the script.

VBA: Convert date to word

Function DateToWords(ByVal xRgVal As Date) As String
' Update by Extendoffice on 20240926
    Dim xYear As String
    Dim Hundreds As String
    Dim Decades As String
    Dim xTensArr As Variant
    Dim xOrdArr As Variant
    Dim xCardArr As Variant
    
    ' Initialize arrays
    xOrdArr = Array("First", "Second", "Third", "Fourth", "Fifth", "Sixth", _
                    "Seventh", "Eighth", "Ninth", "Tenth", "Eleventh", "Twelfth", _
                    "Thirteenth", "Fourteenth", "Fifteenth", "Sixteenth", _
                    "Seventeenth", "Eighteenth", "Nineteenth", "Twentieth", _
                    "Twenty-first", "Twenty-second", "Twenty-third", "Twenty-fourth", _
                    "Twenty-fifth", "Twenty-sixth", "Twenty-seventh", "Twenty-eighth", _
                    "Twenty-ninth", "Thirtieth", "Thirty-first")
    
    xCardArr = Array("", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", _
                    "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", _
                    "Seventeen", "Eighteen", "Nineteen")
    
    xTensArr = Array("Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety")
    
    ' Extract year
    xYear = CStr(Year(xRgVal))
    Decades = Mid$(xYear, 3)
    
    ' Handle decades
    If CInt(Decades) < 20 Then
        Decades = xCardArr(CInt(Decades))
    Else
        Decades = xTensArr(CInt(Left$(Decades, 1)) - 2) & "-" & xCardArr(CInt(Right$(Decades, 1)))
    End If
    
    ' Handle hundreds
    Hundreds = Mid$(xYear, 2, 1)
    If CInt(Hundreds) Then
        Hundreds = xCardArr(CInt(Hundreds)) & " Hundred "
    Else
        Hundreds = ""
    End If
    
    ' Construct English representation of the date
    DateToWords = xOrdArr(Day(xRgVal) - 1) & " " & Format$(xRgVal, "mmmm") & " " & _
                  xCardArr(CInt(Left$(xYear, 1))) & " Thousand " & Hundreds & Decades
End Function


doc date to words 2

3. Save the code and go back to the sheet, select a cell which you will output the result in, type this formula =DateToWords(A2) (A2 is the date you use), press Enter key and drag auto fill handle to over the cells you need. See screenshot:
doc date to words 3doc date to words 4


Unlock the convenience of instantly converting numbers to words in Excel with Kutools for Excel's Numbers to Words feature, saving you time and effort in creating professional-looking documents effortlessly!

Go to Free Downloadn Now


Relative Articles:

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

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...

Description


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!
Comments (25)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
The spelling of 9th is wrong. It's written Nineth, but it should be Ninth.
This comment was minimized by the moderator on the site
Thank you for your message. I have corrected and updated the code accordingly. Thank you.
This comment was minimized by the moderator on the site
07/08/1998 SEVENTH AUGUST TWENTY HUNDRED NINETY-EIGHT
In this vba have error
convert it1998 but it shows TWENTY HUNDRED NINETY-EIGHT
This comment was minimized by the moderator on the site
07/08/1998 SEVENTH AUGUST NINETEEN HUNDRED NINETY EIGHT
I need dob into words in upper format but i use this micros in excel i got this
07/08/1998 SEVENTH AUGUST ONE THOUSAND NINE HUNDRED NINETY-EIGHT which is not usefull
This comment was minimized by the moderator on the site
Hi, MAX, I have modified the VBA, please try and let me know if it works. Thanks.
Function DateToWords(ByVal xRgVal As Date) As String
'UpdatebyExtendoffice20170926
    Dim xYear As String
    Dim Decades As String
    Dim years As String
    Dim xTensArr As Variant
    Dim xyearArr As Variant
    Dim xOrdArr As Variant
    Dim xCardArr As Variant
    xOrdArr = Array("First", "Second", "Third", _
                   "Fourth", "Fifth", "Sixth", _
                   "Seventh", "Eighth", "Nineth", _
                   "Tenth", "Eleventh", "Twelfth", _
                   "Thirteenth", "Fourteenth", _
                   "Fifteenth", "Sixteenth", _
                   "Seventeenth", "Eighteenth", _
                   "Nineteenth", "Twentieth", _
                   "Twenty-first", "Twenty-second", _
                   "Twenty-third", "Twenty-fourth", _
                   "Twenty-fifth", "Twenty-sixth", _
                   "Twenty-seventh", "Twenty-eighth", _
                   "Twenty-nineth", "Thirtieth", _
                   "Thirty-first")
    xCardArr = Array("", "One", "Two", "Three", "Four", _
                   "Five", "Six", "Seven", "Eight", "Nine", _
                   "Ten", "Eleven", "Twelve", "Thirteen", _
                   "Fourteen", "Fifteen", "Sixteen", _
                   "Seventeen", "Eighteen", "Nineteen")
    xTensArr = Array("Twenty", "Thirty", "Forty", "Fifty", _
               "Sixty", "Seventy", "Eighty", "Ninety")
    xYear = CStr(Year(xRgVal))
    
    
      xyearArr = Array("", "One", "Two", "Three", "Four", _
                   "Five", "Six", "Seven", "Eight", "Nine", _
                   "Ten", "Eleven", "Twelve", "Thirteen", _
                   "Fourteen", "Fifteen", "Sixteen", _
                   "Seventeen", "Eighteen", "Nineteen", "Twenty", "Thirty", "Forty", "Fifty", _
               "Sixty", "Seventy", "Eighty", "Ninety")

    years = xyearArr(CInt(Year(xRgVal) / 100)) & " Hundred"
    
    Decades = Mid$(xYear, 3)
    If CInt(Decades) < 20 Then
        Decades = xCardArr(CInt(Decades))
    Else
        Decades = xTensArr(CInt(Left$(Decades, 1)) - 2) & "-" & _
                xCardArr(CInt(Right$(Decades, 1)))
    End If

    DateToWords = UCase(xOrdArr(Day(xRgVal) - 1) & _
                  Format$(xRgVal, " mmmm ") & _
                  years & " " & Decades)
End Function

This comment was minimized by the moderator on the site
07/08/1998 SEVENTH AUGUST TWENTY HUNDRED NINETY-EIGHT
In this vba have error
convert it1998 but it shows TWENTY HUNDRED NINETY-EIGHT
This comment was minimized by the moderator on the site
Hi, try this vba:
Function DateToWords(ByVal xRgVal As Date) As String
'UpdatebyExtendoffice20170926
    Dim xYear As String
    Dim Decades As String
    Dim years As String
    Dim xTensArr As Variant
    Dim xyearArr As Variant
    Dim xOrdArr As Variant
    Dim xCardArr As Variant
    xOrdArr = Array("First", "Second", "Third", _
                   "Fourth", "Fifth", "Sixth", _
                   "Seventh", "Eighth", "Nineth", _
                   "Tenth", "Eleventh", "Twelfth", _
                   "Thirteenth", "Fourteenth", _
                   "Fifteenth", "Sixteenth", _
                   "Seventeenth", "Eighteenth", _
                   "Nineteenth", "Twentieth", _
                   "Twenty-first", "Twenty-second", _
                   "Twenty-third", "Twenty-fourth", _
                   "Twenty-fifth", "Twenty-sixth", _
                   "Twenty-seventh", "Twenty-eighth", _
                   "Twenty-nineth", "Thirtieth", _
                   "Thirty-first")
    xCardArr = Array("", "One", "Two", "Three", "Four", _
                   "Five", "Six", "Seven", "Eight", "Nine", _
                   "Ten", "Eleven", "Twelve", "Thirteen", _
                   "Fourteen", "Fifteen", "Sixteen", _
                   "Seventeen", "Eighteen", "Nineteen")
    xTensArr = Array("Twenty", "Thirty", "Forty", "Fifty", _
               "Sixty", "Seventy", "Eighty", "Ninety")
    xYear = CStr(Year(xRgVal))
    
    
      xyearArr = Array("", "One", "Two", "Three", "Four", _
                   "Five", "Six", "Seven", "Eight", "Nine", _
                   "Ten", "Eleven", "Twelve", "Thirteen", _
                   "Fourteen", "Fifteen", "Sixteen", _
                   "Seventeen", "Eighteen", "Nineteen", "Twenty", "Thirty", "Forty", "Fifty", _
               "Sixty", "Seventy", "Eighty", "Ninety")

    years = xyearArr(Fix(Year(xRgVal) / 100)) & " Hundred"
    
    Decades = Mid$(xYear, 3)
    If CInt(Decades) < 20 Then
        Decades = xCardArr(CInt(Decades))
    Else
        Decades = xTensArr(CInt(Left$(Decades, 1)) - 2) & "-" & _
                xCardArr(CInt(Right$(Decades, 1)))
    End If

    DateToWords = UCase(xOrdArr(Day(xRgVal) - 1) & _
                  Format$(xRgVal, " mmmm ") & _
                  years & " " & Decades)
End Function

This comment was minimized by the moderator on the site
آپ کا بہت شکریہ
This comment was minimized by the moderator on the site
It is giving the #NAME? Error
This comment was minimized by the moderator on the site
I would like to add text to the output, for instance, 1958 gets converted to One Thousand Nineteen Hundred Fifty Eight and I would like it to say One Thousand Nineteen Hundred and Fifty Eight. Can someone give me an example of how I can do this please?
This comment was minimized by the moderator on the site
thank u for helping me . very useful in converting date of birth in word
This comment was minimized by the moderator on the site
Sir/Madam

It is very useful for me.

Really Amazing and helped to solve the problem within a minute.

Thank you for uploading this document. Very nice
This comment was minimized by the moderator on the site
how to use this code in vb6 for a textbox
This comment was minimized by the moderator on the site
date to word in gujarati language avilable ? please answer me. 9427909038
This comment was minimized by the moderator on the site
I think it does not work for other languages except english.
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations