What TEXT does
TEXT takes a value and a format code, and returns the value as text in that format:
=TEXT(value, format_text)
The original cell keeps its number or date. Only the result is text.
Common format codes
| Code | Input | Result |
|---|---|---|
0.00 |
12.5 | 12.50 |
$#,##0.00 |
1234.5 | $1,234.50 |
0% |
0.25 | 25% |
mm/dd/yyyy |
11/24/2026 | 11/24/2026 |
mmm d, yyyy |
11/24/2026 | Nov 24, 2026 |
dddd |
11/24/2026 | Tuesday |
h:mm AM/PM |
14:30 | 2:30 PM |
The examples assume US English settings.
Build a label
Join text and a formatted number with &:
="Total: "&TEXT(B2,"$#,##0.00")
With 1250 in B2, this returns “Total: $1,250.00”. Joining more pieces follows the same rules as how to combine text from cells in excel.
Don’t use TEXT results in calculations
A TEXT result is text, so it doesn’t add, compare or sort like the number it came from. Keep the original cell for calculations, and use TEXT only for display.
Rounding is a separate step
TEXT changes how a number looks, not its value. =TEXT(A2,"0.00") shows two decimal places, but the value underneath keeps all its digits. To change the value itself, use ROUND. Rounding money to the nearest cent is covered in round to nearest cent in excel.
Pitfalls to check
- Format codes depend on language settings. In some languages the codes for year and day are different, so a formula that works on one computer can show the wrong output on another. Check the result on the computer that will use the sheet.
- Minutes and months share a code. In a time format, mm means minutes when it follows h, as in h:mm. Elsewhere it means the month. Mixing them up gives odd results.
- A typo in the function name gives #NAME?. Why does excel show #name error covers that error.
Google Sheets
Google Sheets has a TEXT function with similar format codes. Check each example in your own sheet before you rely on it, since the codes and results can differ with your locale.