Formula Guide

The Excel TEXT Function
explained simply

TEXT converts numbers and dates into formatted text. Here is everything you need — format codes, 6 real examples, and common mistakes.

ExcelPro · 6 min read · Updated June 2026
Contents
  1. What does TEXT do?
  2. Syntax
  3. Format codes reference
  4. 6 real examples
  5. Common mistakes
  6. FAQ

What does TEXT do?

TEXT converts a number or date into formatted text. You control exactly how it looks — as currency, a date in long format, a percentage, a padded code, or any custom pattern. The result is text, not a number, so you can combine it with other text using &.

TEXT is essential for building dynamic labels, creating formatted references, and displaying numbers in reports exactly as you need them.

Syntax

=TEXT(value, format_text)
ArgumentDescription
value requiredThe number, date, or cell reference to format.
format_text requiredThe format code as a text string in quotes. Uses the same codes as Excel cell formatting.

Format codes reference

Format codeExample inputResult
"£#,##0.00"1234.5£1,234.50
"$#,##0"1234.5$1,235
"0.00%"0.15615.60%
"dd/mm/yyyy"Date serial14/06/2026
"d mmmm yyyy"Date serial14 June 2026
"mmmm"Date serialJune
"dddd"Date serialSunday
"00000"4200042
"#,##0"12345671,234,567
"0.0"3.141593.1

6 real examples

Example 1
Format a number as currency
=TEXT(B2, "$#,##0.00")

Converts 1234.5 to "$1,234.50". The # shows digits, the 0 forces zeros, and commas add thousands separators.

Example 2
Build a dynamic sentence with a date
="Report prepared on "&TEXT(TODAY(), "d mmmm yyyy")

Produces: "Report prepared on 14 June 2026". Without TEXT, joining TODAY() with text would produce an ugly serial number like 46356.

Example 3
Display a percentage
=TEXT(B2/C2, "0.0%")

Converts a decimal like 0.156 to "15.6%". Useful when you want the % symbol included in a text label.

Example 4
Pad a number with leading zeros
=TEXT(A2, "00000")

Converts 42 to "00042" — a five-character padded code. The number of zeros sets the total length. Essential for product codes, reference numbers and IDs.

Example 5
Extract the month name from a date
=TEXT(A2, "mmmm")

Returns "June" from a date in A2. Use "mmm" for the short form "Jun". Useful for grouping and labelling charts.

Example 6
Build a reference code combining text and numbers
="INV-"&TEXT(A2, "0000")&"-"&TEXT(TODAY(), "yyyy")

Produces "INV-0042-2026" — a formatted invoice reference from a raw number and today's year.

Common mistakes

⚠️ TEXT result cannot be used in calculations

TEXT converts numbers to text strings. The result looks like a number but cannot be used in SUM, AVERAGE, or arithmetic. If you need to calculate with it, keep the original number and only use TEXT for display.

⚠️ Forgetting to put the format code in quotes

=TEXT(A2, dd/mm/yyyy) errors. The format code must always be in quotes: =TEXT(A2, "dd/mm/yyyy").

⚠️ Currency symbol depends on your locale

Using "£" in the format code hardcodes the pound sign. Use "$" for dollars. For locale-dependent currency, format the cell instead of using TEXT.

FAQ

What is the difference between TEXT and cell formatting?
Cell formatting changes how a number looks without changing its value — the underlying number stays a number. TEXT converts the value to a text string. Use cell formatting for display; use TEXT when you need to combine the formatted value with other text.
Can TEXT format negative numbers differently?
Yes. Use a semicolon to separate positive, negative, and zero formats: =TEXT(A2,"#,##0;(#,##0);-") shows positives normally, negatives in brackets, and zero as a dash.
How do I show a number with commas but no decimal places?
Use "#,##0" as the format code: =TEXT(A2,"#,##0") converts 1234567 to "1,234,567".
Can I use TEXT with VLOOKUP?
Yes, in two ways. Wrap TEXT around a VLOOKUP result to format the returned value: =TEXT(VLOOKUP(...), "dd/mm/yyyy"). Or use TEXT to format a lookup value to match text stored in the table.

Practise TEXT and date formatting

ExcelPro has TEXT formula exercises across all tracks — free to start, no download needed.

Try TEXT exercises →

Related formulas

TEXTJOIN SUBSTITUTE TRIM LEFT DATEDIF VALUE