Text
TEXT Function in Excel
Converts a value to text in a specified number format.
Syntax
- =TEXT(value, format_text)
Arguments
- value (required): The value to format
- format_text (required): Format code as text string
Examples
- =TEXT(1234.5, "$#,##0.00") - Format as currency - Result: $1,234.50
- =TEXT(TODAY(), "MMMM DD, YYYY") - Format date as text - Result: January 21, 2026
- =TEXT(0.25, "0%") - Format as percentage - Result: 25%
Text cleanup before TEXT
- Run [TRIM](/functions/trim/) and [CLEAN](/functions/clean/) on imported keys before lookups.
- Join or split text before analysis — see [TEXTJOIN](/functions/textjoin/) and [TEXTSPLIT](/functions/textsplit/).
- Guide: [Excel text functions](/guides/excel-text-functions-guide/).
Common errors
- Result is text, not number
- Format codes are locale-dependent
Use cases
- Custom formatting
- Report generation
- Concatenating formatted values
Frequently asked questions
- Why use TEXT instead of cell formatting? TEXT converts to actual text, useful when concatenating: ="Report for "&TEXT(A1,"MMMM YYYY"). Cell formatting only changes display; TEXT changes the value to text.
- What are common format codes? Numbers: "#,##0" (thousands), "0.00" (decimals), "$#,##0" (currency). Dates: "MM/DD/YYYY", "MMMM", "DDDD". Time: "HH:MM:SS", "H:MM AM/PM". Percentage: "0%".
- How do I add leading zeros? Use 0s in format: =TEXT(5, "000") returns "005". =TEXT(A1, "00000") pads to 5 digits. Useful for ZIP codes, product codes.
- Can I use TEXT for conditional formatting in formulas? Yes! Use sections: =TEXT(A1, "[Green]0;[Red]-0;0") shows positive green, negative red. Or: =TEXT(A1, "[>100]High;[>50]Medium;Low").
- Why does TEXT return different results in different regions? Some format codes are locale-dependent. Use universal codes when possible, or be aware that date/currency formats may vary. "[$-409]" prefix forces US English formatting.
Editorial review
- Reviewed by Excel.Directory Editorial Team. Updated May 2026.