Excel function

TEXTfunction

Converts a number or date into text with the format you choose.

All versions
=TEXT(46344, "yyyy-mm-dd (ddd)")

Format16 chars

1y
2y
3y
4y
5-
6m
7m
8-
9d
10d
11·
12(
13d
14d
15d
16)

Result16 chars

12
20
32
46
5-
61
71
8-
91
108
11·
12(
13W
14e
15d
16)

Try formats "dddd", "mmmm d, yyyy", "#,##0" and "0.0%". Put 0.256 in value and use "0.0%". Try breaking it on purpose to see the errors.

Result

2026-11-18 (Wed)

value

The number to format. Dates are serial numbers; date text such as "2026-11-18" also works.

format_text

The format code, such as "yyyy-mm-dd" or "#,##0".

What is the TEXT function?

=TEXT(value, format_text)

TEXT turns a number into text using a format code, so you can join it with other text: "Total: "&TEXT(B2, "#,##0") or "Due "&TEXT(A2, "mmm d").

The result is text. It looks like a number or date but can no longer be used in calculations, so keep the original value for math.

Arguments

value
A number, a date, or a cell containing one.
format_text
The format code in double quotes, such as "yyyy-mm-dd", "#,##0" or "0.0%".

TEXT examples

  1. Example 1. Date with weekday

    =TEXT(46344, "yyyy-mm-dd (ddd)")

    The serial number 46344 is November 18, 2026. The result is 2026-11-18 (Wed).

  2. Example 2. Thousands separators

    =TEXT(1234567, "#,##0")

    The result is 1,234,567.

  3. Example 3. Percentage

    =TEXT(0.256, "0.0%")

    The result is 25.6%.

Common mistakes

FAQ

Do format codes depend on language?
Some do. Date codes can differ in some localized versions of Excel; the codes on this page are the English ones.