How to convert date to text in Excel with TEXT function and without formulas

In the previous article, we discussed different ways to convert text to date in Excel. If you are looking for a solution to the opposite task - changing an Excel date to text - a few choices are available to you again.

Traditionally, we'll begin with a formula solution and then explore a couple of non-formula ways.

Using TEXT function in Excel to convert date to text

The Excel TEXT function is specially designed to convert a numeric value to a text string and display it in the format you specify.

The syntax of the Excel TEXT function is as follows:

TEXT(value, format_text)

Where:

  • value is a numeric value you want to convert to text. This can be a number, a formula that returns a numeric value, or a reference to a cell containing a number.
  • format_text this is how you want to format the resulting text value, provided as a text string enclosed in quotation marks.

For example, you can use the following formula to convert a date in cell A1 to a text string in the traditional US date format (month/day/year):

=TEXT(A1,"mm/dd/yyyy")
Using Excel TEXT function to convert a date to a text string

As you see in the screenshot above, the value returned by the TEXT formula is aligned to the left, which is the first sign that points to a date formatted as text. Apart from alignment in a cell, there are a few more indicators that can help you distinguish between dates and text strings in Excel.

Example 1. How to convert date to text strings in different formats

Since Excel dates are serial numbers in their nature, the Excel TEXT function has no problem with converting them to text values. The most challenging part is probably specifying the proper display formatting for the text dates.

Microsoft Excel understands the following date codes.

Months:

  • m - month number without a leading zero
  • mm - month number with a leading zero
  • mmm - short form of the month name, for example Mar
  • mmmm - full form of the month name, for example March
  • mmmmm - month as the first letter, for example M (stands for March and May)

Days:

  • d - days number without a leading zero
  • dd - day number with a leading zero
  • ddd - abbreviated day of the week, for example Sun
  • dddd - full name of the day of the week, for example Sunday

Years:

  • yy - two-digit year
  • yyyy - four-digit year

To display the converted text date exactly the way you want, you can separate the date codes with various delimiters such as dash (-), slash (/), comma (,) colon (:), etc. Here are a few examples:

  • "mm/dd/yyyy" - the date format used in the USA, displays as 03/08/2015
  • "dd/mm/yyyy" - the date format used by the rest of the world, displays as 08/03/2015
  • "dd-mmm-yy" - displays as 08-Mar-15 to avoid any confusion : )
  • "dddd, mmmm d, yyyy" - full date, including the day of the week, displays as Sunday, March 08, 2015

For example, if you have a column of US dates in Excel and you need to export them to a .csv file for your UK based partner, you can convert the dates to the UK format, as a courtesy:

=TEXT(A1,"mm/dd/yyyy")

Some more formula examples and their results are shown below:
Converting dates to text format in Excel using the TEXT function

Example 2. How to convert time to text strings

If your date entries display both dates and times and you want to change them to text strings exactly as they are, you included the following time codes in the format_text argument of the Excel TEXT function.

Hours:

  • h - hours without a leading zero, as 0-23.
  • hh - hours with a leading zero, as 00-23.

Minutes:

  • m - minutes without a leading zero, as 0-59
  • mm - minutes with a leading zero, as 00-59

Seconds:

  • s - seconds without a leading zero
  • ss - seconds with a leading zero

Periods of the day:

  • AM/PM - displays as AM or PM
  • If not specified, 24-hour time format is used

As you probably noticed, the m codes are used for months as well as minutes, and you might be curious how Microsoft Excel distinguishes between them. If you put "m" immediately after h codes (hours) or immediately before s codes (seconds), Excel understands you want to display minutes rather than a month. Yep, it's that simple : )

The TEXT function in Excel allows including both date and time codes in the format_text argument, for example:

=TEXT(A2,"dd/mm/yyyy hh:mm")

If you want to convert the time portion only, then put only the time codes, like this:

=TEXT(A2,"h:mm AM/PM")

The results of your TEXT formulas may look similar to this:
Text formulas to convert date and time to text strings

Example 3. How to convert the current date to text in Excel

In case you want to convert the current date to the text format, you can use the Excel TEXT function in combination with the TODAY function that returns the current date, for example:

=TEXT(TODAY(), "dd-mmm-yyyy")

The result of this formula would show up as 08-Mar-2015. If you prefer to display the resulting text string in some other format, please see the date codes discussed in Example 1.

Example 4. Excel TEXT formula to convert text to date

Though the main destination of the TEXT function in Excel is converting numbers to text, it can also perform a reverse conversion, i.e. change text to date. For this, you simply add the double negation (--) to your TEXT formula.

For example, to convert a text string in cell A1 to date, you use the below formula, and then format the cell as a date.

=--TEXT(A1,"mm/dd/yy")
A TEXT formula to convert text to date

Note. In the above examples, we used the date and time codes for the English locale of Excel. If you have a different locale, the codes may be different for your language.

Converting date to text with Excel's Text to Columns wizard

As you've just seen, Excel's TEXT function makes a good job of converting dates to text. But if you are not a big fan of Excel formulas, you might like this solution better.

If you had a chance to read the previous part of our Excel dates tutorial, you already know how to use Text to Columns to change text to date. To convert dates to text strings, you proceed in the same way with the only difference that you choose Text instead of Date on the final step of the wizard.

Note. The Text to Column wizard always converts dates in the default short date format regardless of how the original dates are displayed in your worksheet. You can find more about default date and time formats in the following article: Default date format in Excel.

If the default date format is not what you are looking for, you can jump right to the next solution that lets you convert dates to text strings in any format of your choosing.

If you don't mind the default format, then perform the following steps:

  1. In your Excel spreadsheet, select all of the dates you want to change to text.
  2. On the Data tab, find the Data Tools group, and click Text to Columns.
    Switch to the Data tab and click Text to Columns.
  3. On step 1 of the wizard, select the Delimited file type and click Next.
    On step 1 of the wizard, select Delimited and click Next.
  4. On step 2 of the wizard, make sure none of the delimiter boxes is checked and click Next.
    On step 2 of the wizard, uncheck all delimiter boxes and click Next.
  5. On step 3 of the wizard, which is the final step, select Text under Column data format and click Finish.

Tip. If you don't want the resulting text strings to overwrite the original dates, specify the Destination for the top cell of the new column.
Converting dates to text format using the Convert Text to Columns Wizard

That was really easy, right? The screenshot below demonstrates the result - dates converted to text strings in the default short date format set in your Windows Regional settings, which is "mm/dd/yyyy" in my case:
Dates converted to text strings in the default short date format

Convert Excel date to text via Notepad

Another quick no-formula way to turn Excel dates into text strings is using Notepad or any other text editor. Unlike the Text to Columns wizard, it allows you to convert Excel date to text in any format of your choosing.

  1. In your Excel worksheet, format the dates exactly as you want the text strings to look like.
  2. Select all of the dates you want to convert and press Ctrl+C to copy them.
    Copy the dates you want to convert to text.
  3. Open Notepad or any other text editor, and paste the copied dates there.
  4. Notepad automatically converts the dates to the text format. Press Ctrl+A to select all text strings, and then Ctrl+C to copy them.
  5. Switch back to Microsoft Excel, select the column where you want to insert the text strings and apply the Text format to it. To do this, press Ctrl+1 to open the Format Cells dialog and select Text on the Number tab.
    Select the column where you want to insert the text strings and apply the Text format to it.
  6. Finally, select the first cell where you want to insert the text strings and press Ctrl+V to paste them.

The following screenshot shows the result, with the original Excel dates in column B and text entries in column D. Please notice that the converted text strings reflect the original date format with absolute accuracy, except they are left-alighted, as all text values are supposed to be in Excel.
The converted text strings look identical to the original dates.

This is how you convert date to text in Excel. Next week we will explorer a few Excel functions to work with weekdays and days of the year. And in the meantime, you may want to check out the previous parts of our comprehensive tutorial to working with dates and times in Excel.

Excel Dates Tutorials:

212 comments

  1. Hi Svetlana Cheusheva,

    Thanks for the notes, it helped me lot.

  2. 3/14/2019 9:30 AM i want this as 14-03-2019 09:00:00
    3/31/2019 6:39 PM - 31-03-2019 18:39:00

  3. Hi Svetlana,

    If I need to convert from text to data the information below, what formula do I have to use?
    10/8/2018
    10/10/2018
    8/8/2019

    I have to mention that I have all this dates in the same column.

    Thank you in advance!
    Roxana

  4. Hi Svetlana,
    I have the following problem:
    I want to subtract the two rows value if both are same date i.e I want to calculate the employee working hours starting time - ending time on a same day ,The values are in diff rows, if only one stamp of employee is there then make it error
    thanks in Advance Please could you help

  5. HI. I have a spreadsheet where the date has been supplied in dd.mm.yy format - Using dots.
    I want to change this to just using the Month. I have tried using the formula =SUBSTITUTE(E2,".","/") but then I can't change than data to only show month?
    Please could you help

  6. Hi Svetlana,
    i have the following problem:
    I can not change the formatting of date that was downloaded form txt file(notepad). From this one 22-10-2018 23:01:01 d/m/yyyy hh:mm:ss to 10-22-2018 23:01:01 m/d/yyyy hh:mm:ss. I even copy that to different sheets but it doesn't work.
    Could you please help with that
    Regards,
    Seymur

  7. GREAT FORMULA !!

  8. A useful article with many good hints and tips but sadly did not address my specific issue.

    I have in Excel a cell '_p_end' which contains a date, say 31/05/2018, which is entered by a user. This is converted to text by =TEXT(_p_end,"dd/mm/yy") to be used in later reports.

    Sadly, some of our users do not use English as their default language. In Excel, for eg a German user, the date displays as 31.05.2018 but it is still a date and may be manipulated as such. However

    TEXT(_p_end,"dd/mm/yy") = #VALUE!

    "dd/mm/yy" is not a valid date format in German.

    How can we overcome this?

    Thank you

    Stuart

  9. Hi hello pls anyone help me in this issue i need convert dates format already in in excel from 15.04.2017 to 15-04-2017
    all the dates are entered with . (dots) only I'm unable to change the format kindly suggest any idea

    • ssrm

      An interesting problem you have posed. I cannot be certain that all of the information needed to answer you is available in your question but potentially there are solutions.

      Firstly you need to know whether the dates like 15.04.2017 are true dates or text.
      Secondly, you need to consider whether the format (appearance) as 15.04.2017 is simply a result of the locale you are using and if so what the default date format is for that locale.

      I presume, because you ask about displaying them as 15-04-2017 that you have already tried to format the dates to display differently using the Format|Cells|Dates options and have found that they do not respond. This suggests that the dates are text not true dates. The locale that is used then becomes irrelevant. Text is literal (wysiwyg).

      So, if the dates are not true dates but simply text, David Carter provides a quite simple solution at https://www.accountingweb.co.uk/tech/excel/exporting-data-from-sage-line-50-into-excel-1-by-david-carter
      I shall not reproduce all that he says here. If when you try to access it you find that it has been taken down, post an email address here and I shall send a copy to you. In brief, it is designed for a column of dates, and uses the Excel Text to columns functionality, so there is an assumption that you have a column of 'dates' which Excel presently treats as text. The solution converts the text to real dates.

      Once you have true dates you can then choose to format the cells as dates in whatever format is appropriate. If the file is to be shared across multiple locales then you may rather than using the standard date formats available for particular locales, which can result in differences such as you see (15.04.2017 which may appear in other locales as 15/04/17, 04/15/17 or even 17/04/15) set up a custom date format.

      For the custom date format, sadly, I cannot help. If we get a good reply to my post below (73), we may then know how to set one up, but as far as I can see Excel does not respond helpfully across locales, so eg dd-mm-yyyy -> 'dd-00-yyyy' in a German locale, and dd-MM-yyyy -> 'dd-05-yyyy'. We have to use TT-MM-JJJJ, which is of little help if you are in a different locale.

      Finally, I have just noticed that you can select a locale for the date format using Format|Cells|Dates, which will allow you to apply a standard format to display 15-04-2017. English (India), possibly others, contains this format. Whether this works if the file is later transferred to a different locale, I am sorry I do not know the answer to that.

      I hope this helps you
      Stuart

  10. hi please help me!
    how to do this i have 3 column with date and i want it if there is a date display the date but if its blank display the other date in the column.

    thanks so much in advance!

    • Hello,
      For me to understand the problem better, please send me a small sample workbook with your source data and the result you expect to get to support@ablebits.com. Please don't worry if you have confidential information there, we never disclose the data we get from our customers and delete it as soon as the problem is resolved.
      Please also don't forget to include the link to this comment into your email.
      I'll look into your task and try to help.

  11. I appreciate this, thanks. 1 question about the recommendations:

    dates converted to text strings in the default short date format set in your Windows Regional settings, which is "mm/dd/yyyy" in my case:

    This does all I need EXCEPT I want to change the short date format the text comes through in. I need it to be yyyy/mm/dd. Do I have to change my regional settings or is there another way to do that?

  12. in sell A1 - TEXT 18102017 please convert this as 18/10/2017 in cell B1

    PL PROVIDE SUITABLE FORMULAS FOR CONVERSION USING =TEXT() FUNCTION

    REGARDS

  13. Hi Svetlana,

    I see you are trying to help users with Excel TEXT function used to format time. Well, I've faced problem in international environment, where different users may have different localization of Excel, as well as different local setting of Windows. It cause funny thing, that date formating in Excel TEXT function vary by local setting, e.g. "YYYY-MM-DD" in whatever English, "RRRR-MM-DD" in Czech, "VVVV-KK-PP" in Finish, etc. Excel is not converting it based on local setting, so formula created in one local setting, doesn't work in others. I understand it as MS Excel bug, but it doesn't help me to solve it.
    Have you ever seen this and are you aware of any solution/workaround, which may work? I'd appreciate any tip here.
    My workaround now is this formula: =YEAR(source date cell)&"-"&MONTH(source date cell)&"-"&DAY(source date cell). I'm not fully happy with the solution, as weakpoint is, it may result in single digit month and/or single digit day, which I want to keep as double digit (like 2017-09-01, instead 2017-9-1). Maybe it can be solved by some IF and counting of characters, but it's going to be way too complex, comparing to =TEXT(source date cell; "YYYY-MM-DD").
    Any idea or tip here is very welcomed.

    Regards, Ales

  14. how to convert date of birth in text
    01/07/1965- First july nineteen sixty five in Excel sheet
    pl what formula i have to write.my mob.number is 9423818133

  15. How to convert date of birth in words. Please help in excel.

    thanks

  16. Hi,
    I am trying to return the number of days between the 2 dates
    AE (6/9/2017 17:30 and AD (2/7/2017 9:35)
    Formula: =TEXT(AE6-AD6,"dd,hh:mm:ss")
    result: 01,07:54:45

    How can I return the 3 digits?
    I tried this formula:
    =INT(AE8-AD8)&"Days" & TEXT(AE8-AD8,"H""hrs""m""mins""")
    but then this does not seem to be in an order if I am trying to filter quickly.
    Could you please advise on this?
    Thanks!

  17. Hi
    I am using "Text to Column" feature to convert date. however it is not converting the 29 February 2017.
    Grateful if you please guide.
    Regards,
    Taufiq

  18. Hello,

    Apologies if you have covered this above, I have tried a bunch of your instructions that look applicable but none seem to work for me.

    I would like to type the following into a cell for today's date for example: 2905, and then for it to change to this: 29/05/17. Or if it needs to have the same amount of digits, type this: 290517 to get this 29/05/17.
    If I want it in the same cell, can this be done by conditional formatting? If not, can the formula go in a cell away from the current columns (so I don't need to have two columns next to each other just for the conversion)?

    Your help is greatly appreciated. If you could spell it out step by step that would be great, I am a bit useless. i.e: "click in A2 where you have typed the date as 2905, then click in cell D2..." :)

    Thanks! Brooke

  19. how to convert date to text in excel.for examble 10/03/2000 is convert to ten-march-two thousand like this

    • Not possible ,
      you can do this formula
      =TEXT(a2,"ddd mmmm yyyy") the output you would receive would be Tue October 2000

  20. How do I create a formula when a specific text is typed in a cell, the current time & date will appear in an assigned cell?:
    A2 = YES
    B2 = (display current time and date)
    A2 = NO
    B2 = (will be blank)
    Thanks!

    • =IF(A1="yes",NOW()," ")
      change the format for b1 so that it shows only time
      ie by going to format cells selecting time and select the appropriate one you required

Post a comment



Thank you for your comment!
When posting a question, please be very clear and concise. This will help us provide a quick and relevant solution to
your query. We cannot guarantee that we will answer every question, but we'll do our best :)