FormulaCamp
Completed
← All functions
Text

TEXT

Number or date as text in a given format.

Syntax

TEXT(value, format_text)

Example: =TEXT(B2,"$#,##0")

Available in: All versions

TEXT converts a number or date into text formatted the way you specify: =TEXT(value, format_text). Use it to build labels such as "Total: $1,234.50" or "Mar 9, 2024", or to pad numbers with leading zeros.

When to use it

Arguments explained

Worked examples

Currency with thousands separator

A
1Amount
21234.5

Formula: C1: =TEXT(A2,"$#,##0.00")

Result: $1,234.50

#,##0 adds the thousands separator, 0.00 forces two decimals.

Readable date

A
1Date
23/9/2024

Formula: C1: =TEXT(A2,"mmm d, yyyy")

Result: Mar 9, 2024

mmm is the short month name, d the day, yyyy the four-digit year. Use "dddd" for the weekday name.

Leading zeros

A
1Invoice
242

Formula: C1: =TEXT(A2,"00000")

Result: 00042

Each 0 is a mandatory digit, so 42 is padded to five characters.

Try it

A tiny spreadsheet with example data. Edit the formula or any number and see the result.

Formula in D2: =TEXT(A2,"#,##0.00")

Example spreadsheet for TEXT
ABCD
1NumberStepResult
21234.567501,234.57
3175
4-4.712
51449
62.53
75012
Result in D2: 1,234.57
Practice this in a lesson: The TEXT and VALUE Functions

Common errors and how to fix them

Related functions

Frequently asked questions

How do I format a percentage with TEXT?
Use =TEXT(0.256,"0.0%"), which gives 25.6%.
How do I get the day of the week from a date?
Use =TEXT(A2,"dddd") for the full name or "ddd" for the short name.
Why does TEXT return a number-looking result that does not add up?
Because it is text. Wrap it in VALUE or sum the original cells.
What is the difference between TEXT and cell formatting?
Cell formatting changes only how a number looks. TEXT creates a new text value you can join into sentences.

More in Text