TEXT Function

TEXT Function

TEXT Function

Converts a number or date into formatted text using a format code.

ExcelClash Team
PUBLISHED

Summary

The Excel TEXT function converts a number or date into a text string using a format code. For example, =TEXT(1250.5,"$#,##0.00") returns "$1,250.50".

TEXT is useful when a value needs to appear in a specific format inside a label, sentence, export field, or helper column. It gives you more control than ordinary cell formatting because the formatted result becomes part of the formula output itself.

Purpose

Format a value as text

Applies a custom number or date format and returns the result as text.

Return Value

A formatted text string

Always returns text, even when the source value is numeric or a date.

Syntax

=TEXT(value, format_text)

value is the number or date you want to format. format_text is the format code in quotation marks, such as "$#,##0.00", "00000", or "yyyy-mm-dd".

Arguments

  • value - [Required] The number, date, or cell reference you want to format.
  • format_text - [Required] The Excel format code that controls how the value should appear.

TEXT vs Other Functions

TEXT is the most flexible display-formatting function in this group. It works well when simpler functions like FIXED or DOLLAR are not enough.

Function Returns Use When
TEXT Formatted text You need a specific custom format
FIXED Formatted text You only need decimal control and optional commas
DOLLAR Formatted text You want a currency-style result with a currency symbol
ROUND Number You need a rounded result that still stays numeric

Using TEXT

TEXT is often used when a number or date has to be inserted into a sentence. Without TEXT, a formula like ="Profit: "&B1 may show a raw value instead of the display style you want. Wrapping the number in TEXT keeps the separators, decimals, symbols, or date pattern under your control.

TEXT is also useful for display-only IDs. A format code like "00000" can show leading zeros without changing the stored number. That is useful when the workbook still needs the original value for calculations or sorting.

  • Use TEXT when the formula result must include a specific display format.
  • Use zero-based codes like "00000" for fixed-width ID display.
  • Keep the original number or date for calculations, because TEXT returns text.

Example 1 - Formatting a Number as Currency

The format code controls the currency symbol, decimal places, and separators. The result looks like a currency value, but it is text.

=TEXT(A1, "$#,##0.00")
// 12.5 -> "$12.50"

=TEXT(B1, "$#,###")
// 5000 -> "$5,000"
Check Answer
Challenge #1
Target: Sheet1!F1
Format a Number as Currency

In cell F1, use TEXT on A1 (12.5) with the format "$#,##0.00". Expected result: "$12.50".

Example 2 - Adding Leading Zeros to an ID

A zero-based format code forces a minimum digit width. If the number is shorter than that width, TEXT pads it with leading zeros in the returned text string.

=TEXT(B2, "00000")
// 123 -> "00123"
// 5   -> "00005"
Check Answer
Challenge #2
Target: Sheet1!F2
Pad a Number with Leading Zeros

In cell F2, use TEXT on B2 (123) with the format "00000". Expected result: "00123".

Example 3 - Formatting a Date as Text

TEXT can return only the part of the date you want to show. That makes it useful in headings, labels, exported text, and date-based summaries.

=TEXT(C1, "yyyy")       // "2026"
=TEXT(C1, "dd/MM/yyyy") // "04/04/2026"
=TEXT(C1, "MMMM yyyy")  // "April 2026"
Check Answer
Challenge #3
Target: Sheet1!F3
Extract the Year from a Date

In cell F3, use TEXT on C1 (a date) with the format "yyyy" to return just the year as text.

Example 4 - Embedding a Formatted Number in a Sentence

This is one of the most common uses of TEXT. It lets a formula produce a finished sentence while keeping the number in a clear display format.

="Profit: "&TEXT(B1, "$#,###")   // "Profit: $5,000"
="Rate: "&TEXT(0.15, "0%")       // "Rate: 15%"
="As of: "&TEXT(C1, "dd MMM yyyy")
Check Answer
Challenge #4
Target: Sheet1!F4
Embed a Formatted Number in a Sentence

In cell F4, combine "Profit: " with TEXT formatting of B1 (5000) as "$#,###".

Be careful with date and time format codes. In date formats, month and minute codes can look similar, so it helps to test the result and confirm the output matches what you intended.

Conclusion Recap

  • Summary: TEXT formats a value and returns the result as text.
  • Syntax: =TEXT(value, format_text).
  • Key point: The result is text, so it should usually be used at the final display step.
  • Practical usage: Currency labels, date labels, leading zeros, and formatted text output.
  • Best pattern: Use TEXT inside concatenation when the displayed format matters.
Tactical Arena
Select Scenario:
Share TEXT Function!

Tell your friends about this post

Discussion

ExcelClash is an interactive platform designed to level up your Excel skills through real-world exercises and challenges. Sharpen your logic, solve real spreadsheet problems, and learn faster.

© 2026 ExcelClash, Inc. All rights reserved.