TEXT Function

Excel 2007+

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

TEXT creates a text result with formatting that persists when combined with other text or used in formulas. Cell formatting only affects display.

Yes, create custom formats using Format Cells dialog (Ctrl+1), then copy the format code including your currency symbol.

TEXT converts numbers to text strings. Reference the original numeric value for calculations.

Use format codes like "# ??/??" for proper fractions (4 1/3) or "? ?/?

Yes, use "0.00E+00" format code for scientific display.

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+