
Converts a number or date into formatted text using a format code.
The Excel TEXT function converts a number or date into a text string using a format code. For example, =TEXT(1250.5,"$#,##0.00") returns "$1,250.50".
TEXT is useful when a value needs to appear in a specific format inside a label, sentence, export field, or helper column. It gives you more control than ordinary cell formatting because the formatted result becomes part of the formula output itself.
Applies a custom number or date format and returns the result as text.
Always returns text, even when the source value is numeric or a date.
=TEXT(value, format_text)
value is the number or date you want to format. format_text is the format code in quotation marks, such as "$#,##0.00", "00000", or "yyyy-mm-dd".
TEXT is the most flexible display-formatting function in this group. It works well when simpler functions like FIXED or DOLLAR are not enough.
| Function | Returns | Use When |
|---|---|---|
TEXT |
Formatted text | You need a specific custom format |
FIXED |
Formatted text | You only need decimal control and optional commas |
DOLLAR |
Formatted text | You want a currency-style result with a currency symbol |
ROUND |
Number | You need a rounded result that still stays numeric |
TEXT is often used when a number or date has to be inserted into a sentence. Without TEXT, a formula like ="Profit: "&B1 may show a raw value instead of the display style you want. Wrapping the number in TEXT keeps the separators, decimals, symbols, or date pattern under your control.
TEXT is also useful for display-only IDs. A format code like "00000" can show leading zeros without changing the stored number. That is useful when the workbook still needs the original value for calculations or sorting.
"00000" for fixed-width ID display.The format code controls the currency symbol, decimal places, and separators. The result looks like a currency value, but it is text.
=TEXT(A1, "$#,##0.00")
// 12.5 -> "$12.50"
=TEXT(B1, "$#,###")
// 5000 -> "$5,000"
In cell F1, use TEXT on A1 (12.5) with the format "$#,##0.00". Expected result: "$12.50".
A zero-based format code forces a minimum digit width. If the number is shorter than that width, TEXT pads it with leading zeros in the returned text string.
=TEXT(B2, "00000")
// 123 -> "00123"
// 5 -> "00005"
In cell F2, use TEXT on B2 (123) with the format "00000". Expected result: "00123".
TEXT can return only the part of the date you want to show. That makes it useful in headings, labels, exported text, and date-based summaries.
=TEXT(C1, "yyyy") // "2026"
=TEXT(C1, "dd/MM/yyyy") // "04/04/2026"
=TEXT(C1, "MMMM yyyy") // "April 2026"
In cell F3, use TEXT on C1 (a date) with the format "yyyy" to return just the year as text.
This is one of the most common uses of TEXT. It lets a formula produce a finished sentence while keeping the number in a clear display format.
="Profit: "&TEXT(B1, "$#,###") // "Profit: $5,000"
="Rate: "&TEXT(0.15, "0%") // "Rate: 15%"
="As of: "&TEXT(C1, "dd MMM yyyy")
In cell F4, combine "Profit: " with TEXT formatting of B1 (5000) as "$#,###".
Be careful with date and time format codes. In date formats, month and minute codes can look similar, so it helps to test the result and confirm the output matches what you intended.
TEXT formats a value and returns the result as text.=TEXT(value, format_text).Tell your friends about this post