Text

TEXT Formula

TEXT converts a number, date, or time to formatted text using a format code string. It is essential when you need to display numbers in a specific format within a CONCATENATE or & expression, format dates as custom strings, or ensure numbers display with leading zeros, commas, or specific decimal places.

Syntax

TEXT(value, format_text)
ParameterDescription
value Parameter of the TEXT function.
format_text Parameter of the TEXT function.
Try TEXT in Viztab — free, no signup

Examples

Format number as currency in text

Formula
="Total: " & TEXT(B2, "$#,##0.00")
Returns: "Total: $1,234.56" — formats the number with dollar sign, commas, and 2 decimals

Format date as readable text

Formula
=TEXT(A2, "MMMM D, YYYY")
Returns: "March 15, 2024" — converts a date value to a formatted text string

Add leading zeros

Formula
=TEXT(A2, "00000")
Returns: "00042" — pads the number 42 with leading zeros to 5 digits

Common Errors

#VALUE!

The format string is invalid. Check the format code syntax — common codes are "0" for digits, "#" for optional digits, and "YYYY" for year.

#NAME?

The format string is missing quotes. It must be a text string in double quotes: TEXT(A1, "0.00") not TEXT(A1, 0.00).

Tips

Common format codes

"$#,##0" for currency. "0.00%" for percentages. "YYYY-MM-DD" for ISO dates. "#,##0" for thousands separator.

Result is always text

TEXT returns a text string, not a number. You cannot do math on the result. Use it only for display purposes.

Day and month names

"DDDD" gives full day name (Monday), "DDD" gives short (Mon). "MMMM" gives full month, "MMM" gives short.

Try TEXT in Viztab

Import your data and use TEXT with 370+ other formulas. No signup required.

Open Viztab

Related Formulas