How-to recipes · Dates and times
How to convert a date to text in Excel
Turn a date into text in any format with TEXT, join dates into sentences without seeing serial numbers, and use format codes for days and months.
Dates are numbers in Excel. As long as they stay in their own cells, the number format makes them look like dates. The moment you join a date with text, for example to build Invoice due 30 Apr 2026, Excel uses the underlying number and you get Invoice due 46142. The same happens when you need a date in a fixed format for a file name, an ID, an export or a label. The TEXT function converts a date into text in exactly the format you choose.
The example data
Two dates in A2:A3: Sunday 15 March 2026 and 30 April 2026.
The formula: TEXT with a format code
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Date | Amount | ||
| 2 | 2026-03-15 | 1250 | Sunday, 15 March 2026 | |
| 3 | 2026-04-30 | 980 |
The result is text, aligned to the left; it no longer behaves like a date.
Result: Sunday, 15 March 2026
The second argument is a format code, the same kind of code you use in custom number formats. The most useful parts:
| Code | Meaning | Example for 15 March 2026 |
|---|---|---|
d / dd | day without / with leading zero | 15 / 15 |
ddd / dddd | short / full weekday name | Sun / Sunday |
m / mm | month number without / with leading zero | 3 / 03 |
mmm / mmmm | short / full month name | Mar / March |
yy / yyyy | two- / four-digit year | 26 / 2026 |
hh:mm | hours and minutes | 00:00 |
Dates inside sentences
Wrap the date in TEXT before joining it with &:
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Date | Amount | ||
| 2 | 2026-03-15 | 1250 | ||
| 3 | 2026-04-30 | 980 | Invoice due 30 Apr 2026 |
Without TEXT the result would read Invoice due 46142.
Result: Invoice due 30 Apr 2026
Other common uses: a report title such as ="Sales report for "&TEXT(TODAY(),"mmmm yyyy"), which always shows the current month with TODAY; a file name such as ="Export_"&TEXT(TODAY(),"yyyy-mm-dd")&".csv", which sorts correctly in folders; and a compact ID such as ="INV-"&TEXT(A2,"yyyymmdd")&"-001".
Microsoft 365: whole columns
TEXT accepts ranges: =TEXT(A2:A3,"mmm yyyy") spills Mar 2026 and Apr 2026. Combined with UNIQUE it produces a list of months that appear in the data: =UNIQUE(TEXT(A2:A100,"yyyy-mm")).
Formatting versus converting
If you only want the date to look different in its own cell, do not convert it: select the cell, press Ctrl+1 [Mac: Cmd+1], choose Custom and type a code such as dddd, d mmmm yyyy. The cell stays a real date that you can sort, filter and calculate with. Convert with TEXT only when you need text: for joining, exporting, or as a grouping key. Number formats are explained in Number formats and custom format codes.
Without formulas: Text to Columns
To permanently turn a column of dates into text in its current display format, there is no single button. The practical way is to add a helper column with =TEXT(A2,"yyyy-mm-dd"), then copy it and paste as values over the original. Typing an apostrophe before a date ('2026-03-15) also stores it as text.
Weekday and month names
The day name of a date is =TEXT(A2,"dddd") (Sunday). For the weekday as a number, use WEEKDAY instead; for the month as a number, MONTH. Numbers are better for sorting and calculations, names are better for labels.
Pitfalls
- Language of the format codes. The codes follow the language of Excel. In a German version the year code is
JJJJ, in Frenchaaaa. A workbook built with"yyyy"can show the code itself on a computer with another language. For international files, prefer the cell format over TEXT, or use the ISO formatyyyy-mm-dd, which is the least ambiguous. - Month vs minute.
mmmeans month, except right afterhor beforess, where it means minutes."hh:mm"shows minutes;"mm"alone shows the month. - Text can't be calculated. After TEXT,
=D2+1returns#VALUE!or a strange result. Keep the original date for calculations. - Sorting text dates sorts alphabetically: 1 Apr comes before 15 Mar. Use the
yyyy-mm-ddformat if the text must sort in date order.