TEXT Function

Formats a number or date as text, using a format code you choose.

Category

Text

Available in

All versions, Microsoft 365

Returns

Text

Taught hands-on in Level 3: Intermediate Lookups & Data Summaries - Text Functions module

Overview

TEXT turns a number into text that looks exactly the way you want — currency, percentages, dates, leading zeros.

You need it whenever you join a number into a sentence: "Total: "&B2 shows 125400, but "Total: "&TEXT(B2, "$#,##0") shows $125,400.

Syntax

=TEXT(value, format_text) Explain

Arguments

ArgumentRequired?What it does
valueYesThe number or date to format.
format_textYesA format code in quotes, the same codes as Format Cells › Custom — for example "$#,##0.00", "0%" or "dd mmm yyyy".

Examples

Example 1 — Numbers inside a sentence

Write a one-line summary for each region.

C2fx=A2&" sold "&TEXT(B2, "$#,##0")
ABC
1RegionSalesSummary
2West125400West sold $125,400
3East98250.5East sold $98,251
4North7300North sold $7,300
=A2&" sold "&TEXT(B2, "$#,##0") Explain

Example 2 — Leading zeros

Employee IDs must always be five digits.

B2fx=TEXT(A2, "00000")
AB
1IDPadded
24200042
3107701077
43015530155
=TEXT(A2, "00000") Explain

Example 3 — Month and weekday names

Label a date with its month or day.

=TEXT(A2, "mmmm") Explain

Use "mmm" for Jan, "dddd" for Monday, "ddd" for Mon, and "mmm yyyy" for Jan 2026.

Common mistakes

  • The result is text. You can't SUM the results of TEXT. Format the cell instead if you only want a number to look different.
  • Format codes depend on language. Date codes like "yyyy" change in some language versions of Excel (for example "jjjj" in German).

Notes

Kyle Stott

Author

Kyle Stott

Certified Microsoft Excel Expert

Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.