What TEXT does

TEXT turns a number or a date into text, in a format you choose with a format code. =TEXT(B3,"mmm d, yyyy") shows the date in B3 as Dec 3, 2026, and =TEXT(B2,"$#,##0.00") shows 1250 as $1,250.00. Its main job is putting numbers and dates into sentences and labels.

When you join a cell into text with & or CONCAT, Excel takes the value and leaves the cell’s format behind, so $1,250.00 joins as 1250 and a date joins as a number such as 46359. TEXT puts a format back on inside the formula. Its codes are the ones you’d type as a custom format in Format Cells.

The result is text, which can’t be added up. Keep the number in a cell of its own for calculations, and use TEXT where the number is shown.

Syntax

=TEXT(value, format_text)
Every argument is required.
valueRequired
The number or date to format: a cell such as B2, or a calculation such as SUM(B2:B9).
format_textRequired
The format code, in quotation marks, written the way you'd write a custom number format: "$#,##0.00", "0%", "mmm d, yyyy".

Example: a payment reminder with an amount and a date

An invoice’s amount is in B2 and its due date in B3. The reminder line in B5 puts both into one sentence.

Without TEXT, the same sentence would read Please pay 1250 by 46359. In B5, ="Please pay "&TEXT(B2,"$#,##0.00")&" by "&TEXT(B3,"mmm d") returns Please pay $1,250.00 by Dec 3.

Each TEXT has its own code: "$#,##0.00" for the amount and "mmm d" for the date, which leaves the year out.

Example: payroll IDs with leading zeros

The payroll upload wants every employee number five digits long, padded with zeros at the front. The formula in B2 is filled down to B4.

Each 0 in the code is a digit that always shows, so every ID comes out five digits long. In B2, =TEXT(A2,"00000") returns 00147.

The results are text, so the zeros are part of the value itself. To show the zeros and keep numbers you can calculate with, give the cells the custom format 00000 in Format Cells instead.

TEXT format codes

For numbers:

Format codeValueTEXT returns
"#,##0"1234.5671,235
"#,##0.00"1234.5671,234.57
"$#,##0.00"1234.567$1,234.57
"0%"0.28529%
"0.0%"0.28528.5%
"00000"14700147

For dates and times, with Dec 3, 2026 at 4:30 PM in the cell:

Format codeTEXT returns
"mmm d, yyyy"Dec 3, 2026
"mmmm d, yyyy"December 3, 2026
"d mmm yyyy"3 Dec 2026
"yyyy-mm-dd"2026-12-03
"dddd"Thursday
"ddd"Thu
"h:mm AM/PM"4:30 PM

In number codes, a 0 always shows a digit, padding with zeros when the number is shorter, while a # shows a digit only when there is one. The comma adds the thousands separator, which follows the computer’s regional settings: a comma in the US, and in some other countries a period.

Common mistakes

  • =TEXT(B2,dddd) shows #NAME?. The format code is text, so it needs quotation marks: "dddd".
  • A total of TEXT results comes out as 0, because SUM skips text. Add up the original numbers and use TEXT only to show the answer.
  • =TEXT(B2,"0%") with 28.5 in B2 shows 2850%. The percent code multiplies by 100, so it expects 0.285 for 28.5%.
  • m and mm mean minutes only straight after h or hh, or just before ss. Anywhere else they mean the month, so =TEXT(B2,"mm") returns the month number, such as 12.
  • Using TEXT on a whole column only to change how it looks turns the numbers into text. To change the look and keep the numbers, use Format Cells: Ctrl+1, or Cmd+1 on a Mac.

Frequently asked questions

How do I convert a number to text in Excel?

Use TEXT with a format code: =TEXT(B2,"0") gives the whole number as text, and =TEXT(B2,"#,##0.00") adds a thousands separator and two decimals. Joining the cell with empty text, =B2&"", also returns text, with no formatting.

How do I keep leading zeros in Excel?

Use a code with one 0 per digit: =TEXT(A2,"00000") turns 147 into 00147. The custom number format 00000 shows the same zeros and keeps the value a number.

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

Put TEXT around the date: ="Due "&TEXT(B3,"mmm d, yyyy") gives Due Dec 3, 2026. Without TEXT, the date joins as its serial number, such as 46359.

How do I get the day name from a date?

=TEXT(A2,"dddd") returns the full name, such as Thursday, and =TEXT(A2,"ddd") the short one, Thu. To test the day in a formula, the number from WEEKDAY is easier to compare.

How do I show a percentage with TEXT?

Use "0%" or "0.0%": =TEXT(B2,"0.0%") shows 0.285 as 28.5%. The cell must hold the fraction 0.285; with 28.5 in it, the result is 2850%.