TEXT Function
Formats a number or date as text, using a format code you choose.
Category
Text
Available in
All versions, Microsoft 365
Returns
Text
Overview
TEXT turns a number into text that looks exactly the way you want — currency, percentages, dates, leading zeros.
You need it whenever you join a number into a sentence: "Total: "&B2 shows 125400, but "Total: "&TEXT(B2, "$#,##0") shows $125,400.
Syntax
Arguments
| Argument | Required? | What it does |
|---|---|---|
| value | Yes | The number or date to format. |
| format_text | Yes | A format code in quotes, the same codes as Format Cells › Custom — for example "$#,##0.00", "0%" or "dd mmm yyyy". |
Examples
Example 1 — Numbers inside a sentence
Write a one-line summary for each region.
| A | B | C | |
|---|---|---|---|
| 1 | Region | Sales | Summary |
| 2 | West | 125400 | West sold $125,400 |
| 3 | East | 98250.5 | East sold $98,251 |
| 4 | North | 7300 | North sold $7,300 |
Example 2 — Leading zeros
Employee IDs must always be five digits.
| A | B | |
|---|---|---|
| 1 | ID | Padded |
| 2 | 42 | 00042 |
| 3 | 1077 | 01077 |
| 4 | 30155 | 30155 |
Example 3 — Month and weekday names
Label a date with its month or day.
Use "mmm" for Jan, "dddd" for Monday, "ddd" for Mon, and "mmm yyyy" for Jan 2026.
Common mistakes
- The result is text. You can't SUM the results of TEXT. Format the cell instead if you only want a number to look different.
- Format codes depend on language. Date codes like "yyyy" change in some language versions of Excel (for example "jjjj" in German).
Notes

Author
Kyle Stott
Certified Microsoft Excel Expert
Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.