Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Converting an Unsupported Date Format.

Converting an Unsupported Date Format

by Allen Wyatt
(last updated July 4, 2015)


It is not uncommon to load information from other programs into Excel. For instance, you may have data generated by another program, and you want to analyze that data in Excel. When you import data into Excel, it does a fairly good job of assigning the proper data types to information, and it can even parse and convert some data.

When it comes to dates and times, however, not all programs speak in a way that Excel can understand. For instance, if your other program stores dates in the format "Mon Jan 10 14:33:03 2011", then Excel won't be able to parse the date and you will need to do the conversion in some other manner.

Fortunately, most programs generate their dates and times in a format that follows a pattern. Assuming, for instance, that "Mon Jan 10 14:33:03 2001" represents the format followed by all dates, you can do the conversion using a simple formula:

=DATEVALUE(MID(A1,9,2)&MID(A1,5,3)&RIGHT(A1,4)) + TIMEVALUE(MID(A1,12,8))

This formula assumes that the foreign date/time format is in cell A1. Simply format the result of the formula using one of Excel's date/time formats, and you'll have no problem.

If you prefer, you can use the Text to Columns function to break the foreign date/time format into its integral parts:

  1. Make sure there are four empty columns to the right of the date/time. This is where Excel will place the various parts of the date/time.
  2. Choose all of the cells containing the foreign dates/times.
  3. Choose Text to Columns from the Data menu. Excel starts the Convert Text to Columns Wizard. (See Figure 1.)
  4. Figure 1. The Convert Text to Columns Wizard.

  5. Make sure that Delimited is selected, then click Next. Excel displays the second step of the wizard.
  6. Make sure the Space check box is selected.
  7. Click Finish.

The dates and times are now separated into five individual columns. You can now use a formula to put a valid date/time back together. For instance, assuming that the exploded version of the date/time is in cells A1:E1, you could use the following:


Again, format the result using a date/time format, and you are all set.

If you prefer to use a macro to do the conversion, then the following macro will step through all the selected cells and do the conversion:

Sub ConvDate()
    Dim c As Range
    For Each c In Selection.Cells
        c = DateValue(Mid(c, 5, 6) & ", " _
          & Mid(c, 21, 4)) + TimeValue(Mid(c, 12, 8))
        c.NumberFormat = "dd MMMM yyyy h:mm:ss"
    Next c
End Sub

The macro converts the text string to an acceptable date/time (using DateValue) and then formats the cell to display the value property.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (3014) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Converting an Unsupported Date Format.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...


Inserting Worksheet Values with a Macro

Macros are often used to process information in a worksheet. You may need your macro to change the values stored in cells; ...

Discover More

Displaying Fields

Fields (sometimes called field codes) allow you to insert dynamic information in your documents. If you want to see the codes ...

Discover More

Stopping Date Parsing when Opening a CSV File

Excel tries to make sense out of any data that you import from a non-Excel file. Sometimes this can have unwanted results. ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!


Adjusting Date Values by Keypress

Excel allows you to store dates in a cell. Wouldn't it be great if you could select a cell containing a date and then ...

Discover More

Setting a Default Date Format

Enter a date into a cell, and Excel allows you to format that date in a variety of ways. Don't see the date format you want? ...

Discover More

Pulling All Fridays

It can be handy to know when specific weekdays occur within a range of dates. Figuring out this information, using formulas, ...

Discover More

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments for this tip:

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is nine more than 2?

2015-07-08 05:30:07


Sir i am new user for exel2007 i want to know how can i convert numerical figure in words( figure)


200 ( two hundred)

Newest Tips

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.

Links and Sharing