Skip to content

TEXT

Converts a number or date to text in the format you specify, such as 1,234.50, 26% or 15-Mar-2025.

Syntax

=TEXT(, )

Text

All versions of Excel.

Try it

Edit the formula in C2 or change the inputs. The sheet recalculates as you type.

C2
A
B
C
1
Invoice
Amount
Text
2
INV-2041
1234.5
1,234.50
3
4

C2 =TEXT(B2,"#,##0.00") returns 1,234.50

How TEXT works

TEXT converts a number, date or time into text, formatted as you specify. Use it when a formatted value has to sit inside a sentence, a label or a joined code. Formatting a cell with a number format changes only how the cell looks. TEXT changes the actual text that other formulas see.

The two arguments

  • value is the number or date to format.
  • format_text is the format code, in quotes.

=TEXT(1234.5,"#,##0.00") returns the text 1,234.50. =TEXT(0.256,"0.0%") returns 25.6%. Dates work the same way: =TEXT(B2,"dd-mmm-yyyy") turns the serial number 45731 into 15-Mar-2025.

Format codes that are safe to rely on

Numbers

| Code | Result for 1234.567 | |---|---| | 0 | 1235 | | 0.00 | 1234.57 | | #,##0 | 1,235 | | #,##0.00 | 1,234.57 | | $#,##0.00 | $1,234.57 |

0 always shows a digit, with a zero if there isn't one, so TEXT(7,"000") gives 007. # shows a digit only if there is one. A percent sign multiplies the value by 100, so TEXT(0.256,"0%") gives 26%.

Negative numbers. A format can have up to four sections separated by semicolons: positive, negative, zero and text. TEXT(-5,"0.00;(0.00)") returns (5.00).

Dates (shown for 15 March 2025)

| Code | Result | |---|---| | d mmmm yyyy | 15 March 2025 | | dd-mmm-yyyy | 15-Mar-2025 | | yyyy-mm-dd | 2025-03-15 | | mmm yyyy | Mar 2025 | | mmmm | March | | dddd | Saturday |

Times. TEXT(0.75,"h:mm AM/PM") returns 6:00 PM, because 0.75 of a day is 18:00.

What you get back is text

The result looks like a number but is text, so it can't be summed or compared as a number. Keep the original value for calculations and use TEXT only where the result is displayed. If you must convert it back, use VALUE.

Where it is used

The usual job is building a sentence: ="Revenue was "&TEXT(B2,"$#,##0")&" ("&TEXT(C2,"0.0%")&" of target)". Without TEXT, Excel would join the raw numbers and you would see 0.256 and 1234.5.

It is also how you add leading zeros to a number that must keep a fixed width, such as =TEXT(A2,"000000"), and how you turn a date into a month label that sorts as text.

Language and regional settings

Format codes are read using your Excel language settings. In some language versions the date letters differ, for example German Excel uses TT.MM.JJJJ instead of dd.mm.yyyy, and the decimal and thousands separators follow your region. A workbook that uses TEXT with date codes can show a different result, or an error, when opened on a computer set to another language.

Minutes and months

The code m means month, unless it comes straight after h or before s, where it means minutes. TEXT(0.75,"h:mm") returns 18:00, with mm as minutes.

Arguments

value
The number, date or time to format. Usually a cell such as B2 or a calculation. If it is text that looks like a number, Excel converts it first. Other text is returned unchanged.
format_text
The number format to apply, in quotes, such as "#,##0.00", "0%" or "dd-mmm-yyyy". It uses the same codes as the Custom category in Format Cells.

Examples

Each example is a live sheet. Change the inputs or the formula and watch the result.

Example 1

Show a number with thousands separators and two decimals

C2 =TEXT(B2,"#,##0.00")

Result: 1,234.50

The result is the text 1,234.50. The cell B2 itself is still the number 1234.5.

C2
A
B
C
1
Invoice
Amount
Text
2
INV-2041
1234.5
1,234.50
3
4

C2 =TEXT(B2,"#,##0.00") returns 1,234.50

Example 2

Put a percentage inside a sentence

C2 =A2&" delivered "&TEXT(B2,"0.0%")&" of sales"

Result: North delivered 25.6% of sales

Without TEXT, the sentence would end in "0.256 of sales".

C2
A
B
C
1
Region
Share
Summary
2
North
25.6%
North delivered 25.6% of sales
3
4

C2 =A2&" delivered "&TEXT(B2,"0.0%")&" of sales" returns North delivered 25.6% of sales

Example 3

Turn a date into readable text

C2 ="Due "&TEXT(B2,"dddd, d mmmm yyyy")

Result: Due Saturday, 15 March 2025

The serial number 45731 is 15 March 2025, which fell on a Saturday. "dddd" is the full weekday name.

C2
A
B
C
1
Invoice
Due date
Notice
2
INV-2041
15-Mar-2025
Due Saturday, 15 March 2025
3
4

C2 ="Due "&TEXT(B2,"dddd, d mmmm yyyy") returns Due Saturday, 15 March 2025

Example 4

Pad a number with leading zeros

C2 =TEXT(A2,"000000")

Result: 000412

Each 0 in the code forces a digit, so 412 is padded to six characters. The result is text.

C2
A
B
C
1
Order no.
Customer
Padded
2
412
Cardigan
000412
3
4

C2 =TEXT(A2,"000000") returns 000412

Example 5

Show negatives in brackets

C2 =TEXT(B2,"#,##0.00;(#,##0.00)")

Result: (1,250.50)

The second section, after the semicolon, applies to negative numbers. The minus sign is not shown because the section has none.

C2
A
B
C
1
Line
Variance
Shown as
2
Freight
-1250.5
(1,250.50)
3
4

C2 =TEXT(B2,"#,##0.00;(#,##0.00)") returns (1,250.50)

Your turn.

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 2

In C2, show the amount in B2 as text with a dollar sign, thousands separators and two decimals, like $1,234.50. Fill it down to C5.

Answer in C2, then it fills down to C5.

C2
A
B
C
D
1
Due date
Amount
Amount (text)
Month
2
15-Mar-2025
1234.50
3
29-Mar-2025
98765.43
4
13-May-2025
0.50
5
13-Jun-2025
2000.00
6
7

Common mistakes

  • TEXT returns text. A result like "1,234.50" can't be summed or sorted as a number. Keep the original cell for calculations and use TEXT only for display.
  • The format code must be in quotes. Write =TEXT(B2,"0.00"). Without the quotes, 0.00 is just the number 0, and the two decimals you meant are lost.
  • Format codes depend on your language settings. Date letters such as d, m, y differ in some languages (German uses T, M, J), so a workbook can show errors or odd results on another computer.
  • Lower-case mm after an hour is minutes, but otherwise it is months. TEXT(B2,"mm") gives the month number, and TEXT(B2,"h:mm") gives minutes.
  • A $ in the format code is a literal dollar sign in any region. For another currency, put its symbol in the code, such as "€#,##0.00".
  • Text that is not number-like is returned unchanged. =TEXT("abc","0.00") returns "abc", with no error to warn you.

Questions people ask

How do I format a number as text in Excel?

Use TEXT with a format code in quotes: `=TEXT(A2,"#,##0.00")` for thousands separators and two decimals, or `=TEXT(A2,"0%")` for a percentage.

How do I show a date in a sentence without it turning into a number?

Wrap the date in TEXT: `="Due "&TEXT(B2,"dd-mmm-yyyy")`. Without it, Excel joins the date's serial number, such as 45731.

How do I add leading zeros to a number?

Use `=TEXT(A2,"000000")` for six digits. The result is text. If the number is already text, such as an ID with the leading zeros stripped, `=REPT("0",6-LEN(A2))&A2` also works.

Why does TEXT return a different result on another computer?

Format codes follow the language and regional settings of the Excel that opens the file. Date and time letters differ between languages, so avoid date codes in files shared across regions, or test them on the target version.

What is the difference between TEXT and formatting a cell?

Cell formatting changes only how a value is displayed. The underlying number is unchanged. TEXT creates a new text value, which is what other formulas, joins and exports see.

Learn TEXT in a real sheet.

TEXT is taught in Logic and text, lesson 17: TEXT for formatting. Each lesson is a short, graded exercise like the one above.