Home  /  Blog  /  Date & Text
Date & Text

TEXT Function in Excel — With Examples (Format Codes for Currency, Dates, Percentages)

By admin 30 November 2026 Date & Text

Your cell says “Order date: ” and you join the date, and Excel gives you “Order date: 46350”. That is the serial number of the date — 24 November 2026 stored as a number — and it is the reason the TEXT function exists. TEXT takes a number or a date and a format code, and gives you back text that looks the way you want: =TEXT(A2, "mmmm d, yyyy") turns that serial into “November 24, 2026”. This guide gives you that function first, then runs it on the ten-order sales table, so you can check each answer yourself — currency, dates, percentages, leading zeros, fractions and scientific notation — plus the format-code table, the serial-number trap, and the one warning that matters: the result is text.

Quick takeaway: a date is a number — TEXT decides how it looks.

  • =TEXT(value, "format code") — the value, and the code in double quotes.
  • =TEXT(1234.567, "$#,##0.00") → $1,234.57. =TEXT(A2, "mmmm d, yyyy") → November 24, 2026.
  • The result is text — keep the original value for calculations, and reference that, not the TEXT result.
  • Joining a date directly shows its serial: 24 November 2026 is 46350.
  • No formula needed for looks alone: Ctrl+1, Format Cells, pick the format.
TEXT Function in Excel — With Examples (Format Codes for Currency, Dates, Percentages)

The Syntax — Value and Format Code

=TEXT(value, format_text)
ArgumentWhat it is
valueThe number or date you want to format — a number, a date, a cell, or another function that returns a number or date
format_textA format code in double quotes that says how to display the value, like “$#,##0.00” or “mm/dd/yyyy”

The tricky part is the format code. It is the same code Excel uses in the Format Cells dialog box — press Ctrl+1, pick a format on the Number tab, choose Custom, and the code is shown in the Type box. The table in the next section lists the ones you will actually use.

The Trap — Why a Date Shows as 46350

A date in Excel is a number — the count of days since 1 January 1900. When you join a date with text using &, Excel shows the number, not the formatted date:

FormulaResult
="Order date: " & A2 where A2 is 24 Nov 2026Order date: 46350
="Order date: " & TEXT(A2, "mmmm d, yyyy")Order date: November 24, 2026
="Price: " & B2 where B2 is 1499.95Price: 1499.95
="Price: " & TEXT(B2, "$#,##0.00")Price: $1,499.95
="Completion: " & C2 where C2 is 0.875Completion: 0.875
="Completion: " & TEXT(C2, "0.0%")Completion: 87.5%

The ampersand joins text, and it does not carry the cell’s formatting with it. TEXT is the fix: it formats the value first, then joins the formatted text. The same trap is why Article 36’s combine-text guide warned that joining a date directly shows its serial — 24 November 2026 is 46350, and the fix is the same TEXT formula.

The Worked Table — Currency, Dates, Percentages

Every example below uses the same ten-order sales table from the COUNTIF, SUMIF and UNIQUE articles — Rep, Region, Sales, Order Date, Status, Notes — in rows 2 to 11, plus a few standalone numbers. Every result was checked against them.

ValueFormulaResult
Sales 1200=TEXT(C2, "$#,##0.00")$1,200.00
Sales 2400=TEXT(C4, "$#,##0")$2,400
Sales 1234.567=TEXT(1234.567, "$#,##0.00")$1,234.57
Total sales 11050="Total: " & TEXT(SUM(C2:C11), "$#,##0.00")Total: $11,050.00
Date 3 Sep 2026=TEXT(D2, "dddd")Thursday
Date 3 Sep 2026=TEXT(D2, "mmmm d, yyyy")September 3, 2026
Date 15 Sep 2026=TEXT(D3, "dddd")Tuesday
Date 2 Oct 2026=TEXT(D4, "mmmm d, yyyy")October 2, 2026
Date 20 Nov 2026=TEXT(D10, "mm/dd/yyyy")11/20/2026
Rate 0.285=TEXT(0.285, "0.0%")28.5%
Rate 0.875=TEXT(0.875, "0.0%")87.5%
ID 42=TEXT(42, "000000")000042
ID 1075=TEXT(1075, "000000")001075
ID 1234=TEXT(1234, "0000000")0001234
4.34=TEXT(4.34, "# ?/?")4 1/3
0.34=TRIM(TEXT(0.34, "# ?/?"))1/3
12200000=TEXT(12200000, "0.00E+00")1.22E+07
Phone 1234567898=TEXT(1234567898, "[<=9999999]###-####;(###) ###-####")(123) 456-7898

Read the rows. The currency row shows the rounding: 1234.567 becomes $1,234.57 — Excel rounds the value to 2 decimal places, it does not cut it off. The date rows show the two codes to remember: “dddd” spells out the full day name, and “mmmm d, yyyy” gives the long written-out date. The leading-zero rows show the rule: each 0 in the format code forces a digit to appear, so six of them turn 42 into “000042” and 1075 into “001075”. And the fraction rows show the TRIM trick: =TEXT(0.34, "# ?/?") gives ” 1/3″ with a leading space, because there is no whole number — TRIM removes it.

The Format Codes — The Ones You Will Actually Use

CodeWhat it doesExample
0Digit placeholder that displays insignificant zeros#.00 — 2.5 displays as 2.50
#Digit placeholder that does not display extra zeros#.## — 2.5 displays as 2.5, 2.555 as 2.56
?Digit placeholder that leaves a space for insignificant zeros — used to align numbers at the decimal point#.?? — up to 2 decimal places, aligned
, (comma)Thousands separator###,###.## — 250000 displays as 250,000.00
. (period)Decimal point0.0 — one decimal place
%Multiplies by 100 and adds the percent sign0.0% — 0.285 displays as 28.5%
$Currency symbol"$#,##0.00" — 1234.567 displays as $1,234.57
d, ddDay of the month, with and without a leading zerod — 3; dd — 03
ddd, ddddDay of the week, abbreviated and fullddd — Thu; dddd — Thursday
m, mmMonth as a numberm — 9; mm — 09
mmm, mmmmMonth as a name, abbreviated and fullmmm — Sep; mmmm — September
yy, yyyyYear, two digits and four digitsyy — 26; yyyy — 2026
h, HHour, 12-hour and 24-hourH:MM AM/PM — 1:29 PM
E+Scientific notation0.00E+00 — 12200000 displays as 1.22E+07

The % code multiplies by 100 — that is why 0.285 becomes 28.5%, not 0.3%. And the 0 and # codes are the pair to learn: 0 forces the digit to appear, # only shows it when there is one. #.00 always shows two decimals; #.## shows up to two.

The Warning — The Result Is Text

TEXT converts a numeric value to a text string. That means you cannot use the result in other calculations:

FormulaResultWhy
=TEXT(1200, "$#,##0.00") + 100#VALUE!“$1,200.00” is text, and text cannot be added
=SUM(TEXT(C2:C11, "$#,##0.00"))0SUM ignores text, so the total is 0
=SUM(C2:C11)11050The original values, still numbers

Keep your original value in one cell, and use the TEXT function in another cell. If you need to build other formulas, always reference the original value and not the TEXT function result. And if the number only needs to look formatted — in a table, not in a sentence — do not use TEXT at all: press Ctrl+1, pick the format, and the cell stays a number.

TEXT vs Custom Number Format — Which One

TEXT functionCustom number format (Ctrl+1)
Changes the valueYes — the result is textNo — the cell stays a number
Works inside a sentenceYes — that is its jobNo — it only changes how the cell looks
Can be used in later calculationsNo — the result is textYes — the value is still a number
Available inAll Excel versionsAll Excel versions

Use TEXT when the formatted value has to live inside a sentence, a label or a concatenated string. Use a custom number format when the number only has to look right in its own cell.

Common Mistakes

MistakeWhat happensFix
You forgot the quotes around the format code#NAME? — Excel reads $#,##0.00 as a namePut the code in double quotes: "$#,##0.00"
You joined a date directly with &The serial shows: 46350 instead of November 24, 2026Wrap it in TEXT first
You used the TEXT result in a calculation#VALUE! or 0 — the result is textReference the original value instead
You used #.## expecting two decimals2.5 shows as 2.5, not 2.50Use #.00 to force the zeros
You used “mm” for the month name“09” — mm is the month as a numberUse “mmm” or “mmmm” for the name
You used “dddd” for a number, not a dateA wrong day name — the number is read as a serialCheck the value is really a date
You formatted a percentage without %0.285 shows as 0.29, not 28.5%Add % to the code: "0.0%"

Frequently Asked Questions

What does the TEXT function do in Excel? It converts a number or date to text using a format code you specify: =TEXT(value, "format code"). It is the way to show a number as currency, a date as a long date, or a decimal as a percentage inside a formula.

How do I show a date as text in Excel? =TEXT(A2, "mmmm d, yyyy") — 24 November 2026 becomes “November 24, 2026”. For the day name alone, =TEXT(A2, "dddd") gives “Tuesday”.

Why does my date show as a number when I join it with text? Because a date is a number — 24 November 2026 is serial 46350 — and & shows the number, not the formatted date. Wrap the date in TEXT first.

Can I use the result of TEXT in a calculation? No. The result is text, so adding to it gives #VALUE! and SUM ignores it. Keep the original value in another cell and reference that.

How do I add leading zeros with TEXT? =TEXT(42, "000000") gives “000042” — each 0 in the format code forces a digit to appear.

What is the difference between TEXT and a custom number format? TEXT changes the value to text, so it works inside a sentence but cannot be calculated with. A custom number format (Ctrl+1) only changes how the cell looks — the value stays a number.

Does TEXT work in older Excel? Yes. TEXT is available in all versions, from Microsoft 365 down to Excel 2007 and lower — unlike UNIQUE and TEXTSPLIT, which need 2021 or later.

That is the TEXT function in Excel: =TEXT(value, "format code") — the value, and the code in double quotes — and it is the answer to the serial-number trap, because a date joined with text shows as 46350 until TEXT formats it. On the numbers and dates in this guide, that one function answers every question: 1234.567 becomes $1,234.57, 24 November 2026 becomes “November 24, 2026” or “Tuesday”, 0.285 becomes 28.5%, 42 becomes “000042”, and 12200000 becomes 1.22E+07. Remember the two things that catch everyone once: the format code goes in double quotes, and the result is text — so keep the original value for calculations and reference that, not the TEXT result. When the number only has to look right in its own cell, skip the function entirely and press Ctrl+1. From here, the next functions worth learning are the ones this one sits next to — the day of the week guide for the same “dddd” code on dates, the combine text guide for joining the formatted pieces together — and the full learning order for the whole site is on the Excel Formulas hub and the Date & Text topic page.


About admin

Author of Excel formula guides on this blog.

View all guides by admin →

Keep Learning

Related guides