Menu

Excel TEXT Function: Format Numbers and Dates as Text

=TEXT(A2,"mmm d, yyyy") turns the date in A2 into text such as Mar 15, 2026, and =TEXT(B2,"$#,##0.00") turns 1250.5 into $1,250.50. The result is text, so use it for labels, not for further math.

Every sheet on this page is live: change a number or a formula and it recalculates.

=TEXT(A2,"mmm d, yyyy") turns the date in A2 into the text Mar 15, 2026, and =TEXT(B2,"$#,##0.00") turns the number 1250.5 into $1,250.50. The second argument is a format code, in quotes, written with the same codes as Format Cells > Custom.

Format a date and a number as text
C2
ABCD
1DateAmountDate as textAmount as text
22026-03-151250.5Mar 15, 2026$1,250.50
3Sunday1,251
42026-03-151250.5
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

Change the date in A2 or the amount in B2 and the six texts follow. TEXT works in every Excel version and in Google Sheets.

Date format codes

One date, many formats
B2
ABCD
1CodeResultDate
2d52026-03-05
3dd05
4dddThu
5ddddThursday
6mmmMar
7mmmmMarch
8dd/mm/yyyy05/03/2026
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.
  • d and dd: the day, without and with a leading zero.
  • ddd and dddd: the weekday, short and long (Thu, Thursday). More on this on the weekday page.
  • m, mm, mmm, mmmm: the month as 3, 03, Mar, March.
  • yy and yyyy: the year as 26 or 2026.

Type another code in column A, such as mmmm yyyy or ddd d mmm, and column B shows it. Format codes depend on the language of your Excel: German Excel writes TT.MM.JJJJ where English Excel writes dd.mm.yyyy.

Day of the week
B2
AB
1DateWeekday
22026-03-09
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

Your turn: In B2, return the full weekday name of the date in A2, such as Monday.

Number, currency and percent codes

Code1234.567 becomesMeaning
01235whole number, rounded
0.001234.57two decimals
#,##01,235thousands separator
$#,##0.00$1,234.57currency
0%123457%multiplied by 100, percent sign
000000001235at least 6 digits, leading zeros

0 is a digit that is always shown, # a digit shown only when needed. Try them here:

Number codes
C2
ABC
1ValueCodeResult
21234.5670.001234.57
30.2560.0%25.6%
442000000000042
5-1500#,##0;(#,##0)(1,500)
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

The last code has two sections separated by a semicolon: the first is for positive numbers, the second for negative ones, here in parentheses as accounts often show them. Padding with zeros, as in row 4, is covered on the leading zeros page.

Show a rate as a percent
B2
AB
1RateLabel
20.125
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

Your turn: In B2, return the rate in A2 as text with one decimal and a percent sign, such as 12.5%.

Combine text with a formatted number or date

This is the most common reason to use TEXT. Joining a number with & drops its format, so the value is joined as it is stored:

A sentence with a date and an amount
C2
ABC
1DueAmountMessage
22026-04-301250.5Pay $1,250.50 by April 30
3Pay 1250.5 by 46142
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

C3 shows why: without TEXT the date joins as its serial number and the amount as a plain number. For times, use codes such as "h:mm AM/PM" or "hh:mm", and "[h]:mm" for durations over 24 hours. Next to h or s, mm means minutes, not months. Concatenate has more on joining text.

Common mistake: TEXT stops the math

TEXT returns text. It looks like a number, but SUM skips it and the cell is aligned like text:

Formatted text does not add up
B5
AB
1PriceTEXT(price,"0.00")
212.512.50
388.00
420.2520.25
540.750
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

B5 totals 0. If you only want numbers to look different, keep them as numbers and change the cell format instead: select the cells, press Ctrl+1 (Cmd+1 on a Mac), and pick a format under Number or type the same code under Custom. The cell then looks the way TEXT would make it, and it still adds up.

Frequently Asked Questions

What does the TEXT function do in Excel?

It converts a number or date to text in the format you give: =TEXT(A2,"$#,##0.00") returns $1,250.50 for 1250.5. It is mostly used to keep a format when joining a value with other text.

How do I convert a date to text in Excel?

=TEXT(A2,"yyyy-mm-dd") returns 2026-03-15; "mmm d, yyyy" returns Mar 15, 2026; "dddd" returns the weekday name, such as Sunday.

Why can't I add up the results of TEXT?

TEXT returns text, and SUM skips text, so a column of TEXT results totals 0. Keep the numbers in their own cells and use Format Cells (Ctrl+1) to change how they look; use TEXT only for labels.

Why does my TEXT format code not work in a German or French Excel?

Date codes follow the language of Excel: German Excel writes the year as JJJJ and the day as TT, so =TEXT(A2;"TT.MM.JJJJ"). Codes copied from an English example show the letters literally.

Coddy programming languages illustration

Learn to code with Coddy

GET STARTED