Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel Convert Date to Text String: How-To

· 4 min read · Home Tech

In this article
  1. Why Convert a Date to Text?
  2. The TEXT Function: The Core Method
  3. Worked Example: Concatenating a Date with Text
  4. Alternative Methods: Text to Columns, Formatting, and Power Query
  5. Common Mistakes and How to Avoid Them
  6. How to Convert Text Back to a Date
  7. Frequently Asked Questions

To convert a date to a text string in Excel, use the TEXT function: =TEXT(A1,"mm/dd/yyyy") replaces the date with text in the format you specify. This article explains the TEXT function, the DATEVALUE reverse, and several alternative methods for different situations.

Why Convert a Date to Text?

Excel stores dates as serial numbers (e.g., 1 represents January 1, 1900) and displays them as dates only because of cell formatting. Sometimes you need the date as an actual text string: to concatenate it with other text, to use it in a VLOOKUP that requires matching text, to export data to a system that expects text, or to avoid Excel's automatic date conversion when typing dates like “01-02-2020” into a CSV. Converting to text gives you full control over the display and prevents accidental reformatting.

The TEXT Function: The Core Method

The TEXT function converts a numeric value to text using a format code. Its syntax is TEXT(value, format_text).

  • value – the cell reference or date serial number
  • format_text – a quoted string that defines the output format

Common format codes:

  • "yyyy-mm-dd" → 2025-03-14
  • "dd-mmm-yyyy" → 14-Mar-2025
  • "mmmm d, yyyy" → March 14, 2025
  • "dddd mmmm d" → Friday March 14

For example, if cell A1 contains a real date, =TEXT(A1,"yyyy-mm-dd") returns the text “2025-03-14”. Note that the result is left-aligned by default (text) and not a true date.

Worked Example: Concatenating a Date with Text

Suppose you have a date in B2 (say 2025-06-01) and you want the text “The event is on June 1, 2025”. Use:

= "The event is on " & TEXT(B2,"mmmm d, yyyy")

This returns the exact string because the TEXT function converts the date to text before concatenation. Without TEXT, Excel would show the serial number (e.g., 45809) because concatenation converts the date to its underlying number.

Alternative Methods: Text to Columns, Formatting, and Power Query

Besides TEXT, you have other options depending on your goal:

  • Text to Columns – Select the date column, go to Data > Text to Columns, choose “Delimited”, then “Next” twice, and in step 3 choose “Text”. This converts the displayed date to text but keeps the current display format (e.g., if the cell shows “14-Mar-2025”, that becomes text).
  • Cell Formatting (not true text) – Right-click > Format Cells > Number > Text. This changes the display but the cell still holds a serial number; it only becomes text when you re-enter the value. Not reliable for conversion.
  • Power Query – Load the data, change the column type to “Text” in the Transform tab. This gives a text version of the date using your locale’s format.
  • VBA – A simple macro can loop through cells and set cell.NumberFormat = "@" and then cell.Value = Format(cell.Value, "mm/dd/yyyy"). Use only if you need automation.

Choose TEXT for a formula-based, dynamic solution; Text to Columns for a one-time conversion; Power Query for repeated imports.

Common Mistakes and How to Avoid Them

  • Using TEXT with a text-looking date – If A1 already contains text (e.g., “2025-03-14” as text), TEXT will return the same text, not convert it. Use DATEVALUE first to turn it into a real date.
  • Locale issues – Format codes like “m/d/yyyy” may not work in non-US Excel. Use “yyyy-mm-dd” which is locale-independent.
  • Forgetting quotes – The format code must be in double quotes. =TEXT(A1, yyyy) fails.
  • Losing the date nature – Once converted to text, you cannot perform date arithmetic on it. If you need to sort by date, keep the original date column.

Also, when importing CSV files, Excel may convert strings like “01-02-2020” into dates. To prevent that, import the file using Text Import Wizard and set the column as Text.

How to Convert Text Back to a Date

To reverse the process, use the DATEVALUE function: =DATEVALUE("2025-03-14") returns the serial number for that date. Then format the cell as a date. If the text includes a time, use DATEVALUE plus TIMEVALUE or simply =VALUE(A1) if the text is in a recognized date format. This is useful when you receive data as text and need to perform calculations.

Frequently Asked Questions

How do I convert a date to text without losing the format?

Use the TEXT function with your desired format code. For example, =TEXT(A1,"dd-mmm-yyyy") gives “14-Mar-2025” as text. The original cell remains unchanged.

Why does my TEXT formula return a number?

If the format code is invalid or the value is not a real date, TEXT may return the serial number or an error. Ensure the value is a date (check with ISDATE) and the format code is correct (e.g., “yyyy-mm-dd”).

Can I convert a date to text in Excel Online?

Yes, the TEXT function works in Excel for the web. The same syntax applies. Text to Columns is also available under Data.

How do I convert a date to text in a formula that concatenates?

Use the ampersand operator with TEXT: ="Date: " & TEXT(A1,"mm/dd/yyyy"). This ensures the date appears as text, not a serial number.

What is the difference between TEXT and formatting a cell as text?

Formatting a cell as Text only changes the display; the underlying value remains a date serial. TEXT actually converts the value to a text string, which can be used in string functions like LEFT or LEN.

Is there a way to convert a date to text with a leading zero?

Yes, use a format code like "mm/dd/yyyy" which always shows two digits for month and day. For example, March 5 becomes “03/05/2025”.