WorkbookLogic
FunctionTextintermediateTEXTIF

TEXT Function

By WorkbookLogic

The Excel TEXT function converts a numeric value into text using a specified number-format code. It is especially useful when formatted numbers or dates must be embedded in a text string.

ExcelLast reviewed Sep 11, 2026
text-function-v1.0.0.xlsx
Excel TEXT Function
TEXT converts a numeric value to text using an explicit display format.
Source cases, editableTEXT examples
ScenarioValueFormat codeData noteOutput typeExampleFormula syntaxResult
Currency1234.56$#,##0Rounds to whole unitsTextCurrency=TEXT(B12,C12)$1,235
Percentage0.1250.0%Scales and appends %TextPercentage=TEXT(B13,C13)12.5%
Date labelAug 15, 2026dd-mmm-yyyyTrue date inputTextDate label=TEXT(B14,C14)15-Aug-2026
Unit label420 "units"Appends a text unitTextUnit label=TEXT(B15,C15)42 units
Decimal label3.14160.00 "x"Rounds and appends xTextDecimal label=TEXT(B16,C16)3.14 x
How TEXT behaves
TEXT applies the supplied format code inside the formula rather than relying on the source cell's display.
The result is text, so it is suitable for labels and concatenation but not direct numeric aggregation.
Displayed precision can round the text without changing the underlying source value.
Reliability checks
Currency example returns the expected rounded textOK
Percentage example returns 12.5 percent textOK

Overview

The Excel TEXT function applies a number-format code and converts the result to text. It is most useful when a formatted number, date, or time must appear inside a label, export field, or joined string.

Quick reference

Syntax: =TEXT(value, format_text)

Returns: A text string displaying the numeric value in the requested format. (text)

Arguments:

  • value (required) — The numeric value, date serial, time, or reference to format.
  • format_text (required) — A valid Excel number-format code supplied as text.

Both arguments are required. The format code must be supplied as quoted text, and the returned result is text even when the source value is numeric.

Common uses

  • Insert a formatted amount, percentage, date, or time into a sentence.
  • Create consistent export labels or identifiers.
  • Preserve leading zeros in a generated text code.
  • Produce readable date labels for reports and charts.

Calculations

TEXT formats the numeric value according to format_text, then returns the displayed characters as text. Format codes can control decimal places, thousands separators, percentages, currencies, dates, and times.

Because the output is text, it no longer behaves like the original number in arithmetic. Use normal cell formatting when the value must remain numeric. Use TEXT when formatting must travel with the characters—for example, during concatenation.

Dates and times are numbers in Excel. Without TEXT, joining a date to a sentence exposes its serial number rather than the cell's display format.

Function behavior

Situation

Behavior

Numeric input

Converted to formatted text.

Date or time input

Its serial value is displayed using the supplied date or time code.

Text input

Number formatting is not meaningfully applied because the source is already text.

Reduced decimal precision

Displayed text is rounded to the requested precision.

Downstream arithmetic

The result is text and should not be treated as a numeric input.

Invalid format code

Can return unexpected text or an error.

Locale-sensitive symbols

Some displayed separators and names depend on the Excel locale.

Common errors

Using TEXT only to change cell appearance

What happens:
The numeric value becomes text and no longer aggregates normally.

Better approach:
Use ordinary cell number formatting unless the formatted characters must be part of text.

Forgetting quotation marks around the format code

What happens:
Excel cannot interpret the second argument as the intended text code.

Better approach:
Use a quoted code such as "0.0%" or reference a cell containing the code.

Formatting a date stored as text

What happens:
TEXT cannot repair an invalid or ambiguous date string.

Better approach:
Convert the source to a true Excel date before applying TEXT.

Example

Example 1 — Format Currency

=TEXT(B12,C12)

The workbook formats the source amount with its visible currency code and returns $1,235.

Example 2 — Format a Percentage

=TEXT(B14,C14)

With value 0.125 and format code 0.0%, the result is the text 12.5%.

Example 3 — Format a Date

=TEXT(A1,"mmmm d, yyyy")

A true Excel date is returned as text such as August 16, 2026.

Example workbook

The workbook contains a TEXT Example sheet with five editable numeric or date values and format codes. Live formulas demonstrate currency, percentage, date, and other display patterns, while two checks confirm the currency and percentage outputs. A Notes sheet explains format codes and numeric-versus-text behavior.

Key takeaway

Use TEXT when formatting must become part of a text result; use normal number formatting when the underlying value must remain numeric.