Excel TEXT Function: Format Dates, Numbers and Currency with Examples

Excel TEXT formula tutorial cover

What does the TEXT function do in Excel?

The TEXT function converts a numeric value, date or time into a text string using a format code you specify. It is useful for building readable labels, reports and messages. Because the result is text, keep original numeric cells for calculations.

TEXT syntax

=TEXT(value,format_text)

value is a number or Excel date/time serial; format_text is a formatting pattern in quotes, such as "dd mmm yyyy", "0.00%" or "#,##0.00".

Example 1: Format a date

Suppose A2 contains the actual Excel date 15 November 2026.

=TEXT(A2,"dd mmm yyyy")

Result: 15 Nov 2026. The original cell remains a date; the formula result is a text representation.

Example 2: Show a month and year

=TEXT(A2,"mmmm yyyy")

Result: November 2026. This is useful for report headings. For calculations grouped by month, use date values rather than text keys when possible.

Example 3: Display two decimal places

If B2 contains 1234.5:

=TEXT(B2,"#,##0.00")

Result: 1,234.50 in a locale that uses a comma thousands separator and dot decimal point.

Example 4: Create a percentage label

If B2 contains 0.875:

=TEXT(B2,"0.0%")

Result: 87.5%. The percent format multiplies the displayed number by 100. Do not use it with 87.5 unless that input already represents 8750%.

Example 5: Preserve leading zeros in an ID label

If B2 contains the number 42:

=TEXT(B2,"00000")

Result: 00042. This is useful for displaying fixed-length IDs. If an identifier originally includes significant leading zeros, consider storing it as text from the beginning.

Example 6: Combine TEXT with other words

If A2 contains 15 November 2026 and B2 contains 1250:

="Invoice dated "&TEXT(A2,"dd mmm yyyy")&" — Amount: "&TEXT(B2,"#,##0.00")

Result: Invoice dated 15 Nov 2026 — Amount: 1,250.00.

Example 7: Format time in a message

If C2 contains 14:30 as an actual Excel time:

=TEXT(C2,"h:mm AM/PM")

Result: 2:30 PM. The underlying time value can still be used for arithmetic in C2.

TEXT vs cell formatting

Use Format Cells when you want to change how a number appears without changing its data type. Use TEXT when you specifically need a formatted text result, for example inside a sentence, email draft or combined label.

Common errors

  • Result is text: avoid summing TEXT outputs; calculate from the numeric source.
  • Wrong date output: ensure the input is a real date, not an ambiguous text string.
  • Locale differences: separators and date wording can vary with Excel language and regional settings.
  • Misplaced format quotes: format_text must be a quoted string or cell reference containing a format code.
  • Unwanted zeros: compare the 0 and # formatting placeholders to choose mandatory or optional digits.

FAQs

Does TEXT change the source number?

No. It returns formatted text in the formula cell.

Can TEXT show currency symbols?

Yes, for example =TEXT(B2,"₹#,##0.00") can add a rupee symbol where the format and locale support it.

Why does my date show as a number when joined with text?

Excel stores dates as serial numbers. Apply TEXT with an appropriate date format when combining them with strings.

Practice exercise

Build an invoice table with Date, Amount and Completion Rate. Create an invoice summary that displays the date as dd mmm yyyy, amount with two decimals and completion as a percentage.

Related Excel tutorials

Explore our Excel Functions learning module for more practical tutorials, including text, dates and logical formulas.

Official reference

See Microsoft Excel Support for official function documentation and version notes.