TEXT Function
Formats a number or date as text using a format code.
Syntax
Parameters
| Parameter | Description | Required |
|---|---|---|
| value | The numeric value, date, time, or cell reference to format. | Required |
| format_text | A text string enclosed in quotes that specifies the number format, e.g. "0.0%" or "yyyy-mm-dd". | Required |
Basic Example
Show a fraction as a percent
=TEXT(0.25,"0.0%")0.25 is formatted with one decimal of percent precision, producing the text string "25.0%".
Advanced Examples
Example 1: Format a date
Building a label from a date cell A1 containing 2024-01-15Convert a date into a readable text label
=TEXT(A1,"yyyy-mm-dd")Example 2: Thousands separator with currency
Display 1234567 as moneyApply a thousands and currency format
=TEXT(1234567,"$#,##0.00")How TEXT Works
TEXT takes a numeric value and applies the formatting codes from format_text (which mirror custom number formats). The result is always a text string, not a number, so it can no longer be used directly in math without conversion back via VALUE.
Important Notes & Limitations
The output is text, so it cannot be used directly in arithmetic without converting back with VALUE.
Format codes are locale dependent (decimal and thousands separators differ by region).
TEXT cannot reformat an already-text string; it only formats underlying numeric/date values.
Common Errors & Fixes
#VALUE! errorThe format_text argument is missing or is not a valid text string.Fix: Provide a quoted format code such as "0.0%".
Unexpected outputForgetting quotes around the format code turns it into a defined name or range.Fix: Always enclose the format code in double quotes.
Download Practice File
TEXT
textPractice TEXT with Real Data
Download a sample CSV file with pre-populated data and practice exercises for the TEXT function. Works in both Excel and Google Sheets.
File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps