Quick Navigation
TEXT Function
Summary
The TEXT function transforms numeric values, dates, and times into formatted text strings using custom format codes. Perfect for creating professional reports, combining numbers with text while preserving exact formatting, or displaying values in specific regional formats.
Syntax
TEXT(value, format_text)
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| value | Number/Date/Time |
Yes | The value to format (number, date, or time) |
| format_text | String |
Yes | Text string with format codes controlling the output appearance |
Using the TEXT Function
TEXT is essential when you need to display numbers with specific formatting within text strings or reports. Use it to format currency values, dates, percentages, or any numeric data while maintaining precise control over the appearance.
Common TEXT Examples
Currency Formatting
=TEXT(1234.567, "$#,##0.00")
Displays as $1,234.57 with currency symbol and 2 decimals
Date Formatting
=TEXT(TODAY(), "MMMM DD, YYYY")
Shows full date like "December 11, 2025"
Percentage
=TEXT(0.285, "0.0%")
Converts to "28.5%" percentage format
Leading Zeros
=TEXT(1234, "00000")
Pads with zeros to show "01234"
Time Format
=TEXT(NOW(), "HH:MM AM/PM")
Displays current time like "02:30 PM"
Phone Number
=TEXT(1234567890, "[<=9999999]###-###-####;(###) ###-####")
Formats as (123) 456-7890
Frequently Asked Questions
Common Errors and Solutions
#VALUE! error
Cause: format_text contains invalid characters or value is not numeric/date
Solution: Verify format_text syntax and ensure value is numeric
Incorrect formatting
Cause: Wrong format code syntax
Solution: Use Format Cells dialog to test and copy correct format codes
Missing formatting
Cause: format_text not in quotes
Solution: Always enclose format_text in double quotes "format"
Notes
- TEXT output is always text, even if it looks like a number
- Format codes are case-insensitive (MM = mm)
- Use Ctrl+1 > Custom to discover format codes
- Does not support color formatting from Format Cells
- Keep original values separate for calculations
Compatibility
Available in: Excel 2007, Excel 2010, Excel 2013, Excel 2016, Excel 2019, Excel 2021, Excel 365
Not available in:
Content last reviewed: December 11, 2025
Update frequency: As needed
Excel versions tested: Excel 2007+