ExcelReady
CourseFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before the interview. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Function guides
  • Blog

Product

  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Text
  3. The TEXT Function: Format Numbers and Dates Inside Text

The TEXT Function: Format Numbers and Dates Inside Text

By ExcelReady Team·Updated October 30, 2026·6 min read

The short answer

The TEXT function turns a number or date into text with the format you choose: =TEXT(value, format_text). For example, =TEXT(B2,"mmm d, yyyy") shows a date as Feb 3, 2025, and =TEXT(C2,"$#,##0.00") shows $1,250.50. Use it when you join numbers or dates to words, because & otherwise shows the raw stored number.

Key takeaways

  • Syntax: =TEXT(value, format_text). The format code goes in double quotes.
  • Date codes: d, dd, ddd, dddd for days; m, mm, mmm, mmmm for months; yy, yyyy for years.
  • Number codes: 0 always shows a digit, # shows one only when needed, a comma adds thousands separators.
  • The result is text, so you can't do math with it. Keep the original number for calculations.
  • Format codes depend on your Excel language and regional settings.
On this page+
  1. What does the TEXT function do?
  2. Why do numbers and dates look wrong when you join them to text?
  3. Excel TEXT function date format codes
  4. Number format codes for TEXT
  5. How to put numbers and dates inside a sentence
  6. TEXT vs Format Cells: which should you use?
  7. Format codes can vary by language and region
  8. TEXT and other text functions
  9. Practise it

The Excel TEXT function turns a number or date into text in the exact format you choose, such as $1,250.50 or Feb 3, 2025. You need it whenever you put a number or date inside a sentence or label, because joining them with & shows the raw stored value instead. This guide covers the syntax, the format codes you'll use most, and the traps, including codes that change with your language settings.

What does the TEXT function do?#

TEXT takes a value and a format code, and returns the value as formatted text. The syntax:

Excel formula
=TEXT(value, format_text)

value is the number or date, usually a cell. format_text is the format code, in double quotes, such as "mmm d, yyyy" or "$#,##0.00". TEXT works in every version of Excel.

The examples use this payments table:

ABC
1ClientPaid OnAmount
2Acme CorpFeb 3, 2025$1,250.50
3BrightlineFeb 14, 2025$980.00
4Cedar HealthMar 1, 2025$12,400.75
5Delta FreightMar 19, 2025$315.20

Column B holds real dates and column C real numbers; the dates and dollar signs are only cell formatting.

Why do numbers and dates look wrong when you join them to text?#

The & sign joins the value Excel stores, not what the cell shows. Try it:

Excel formula
="Paid on "&B2

The result is Paid on 45691. Excel stores each date as a number of days since January 1, 1900, and Feb 3, 2025 is day 45,691. The same happens with amounts: ="Total: "&C2 gives Total: 1250.5, without the dollar sign or the second decimal. Cell formatting is lost the moment the value becomes part of text. Why Excel dates are numbers explains this in more detail.

TEXT fixes it by applying the format inside the formula.

Excel TEXT function date format codes#

Date codes use d for day, m for month and y for year. The number of letters controls the style. All of these use Feb 3, 2025 in B2:

CodeShowsFormulaResult
d / ddDay, 3 or 03=TEXT(B2,"dd")03
ddd / ddddShort or full weekday=TEXT(B2,"dddd")Monday
m / mmMonth number, 2 or 02=TEXT(B2,"mm")02
mmm / mmmmShort or full month name=TEXT(B2,"mmmm")February
yy / yyyy2- or 4-digit year=TEXT(B2,"yyyy")2025
combinedMonth, day and year=TEXT(B2,"mmm d, yyyy")Feb 3, 2025
combinedYear first=TEXT(B2,"yyyy-mm-dd")2025-02-03

Mind the m: in a date code, m means month. For minutes in a time, use it next to an hour, as in "h:mm AM/PM".

Number format codes for TEXT#

Number codes are built from a few symbols. 0 is a digit that always shows, # is a digit that shows only when needed, a comma adds a thousands separator, and .00 fixes the number of decimals:

CodeValueResult
"$#,##0.00"1250.5$1,250.50
"#,##0"12400.7512,401
"0.0"315.2315.2
"0%"0.25626%
"0.0%"0.25625.6%
"00000"4200042

TEXT rounds to the decimals in the code, so 12,400.75 with "#,##0" shows 12,401. Percent codes multiply by 100 for you. Zeros in front, as in "00000", pad short numbers, which is handy for IDs and ZIP codes.

How to put numbers and dates inside a sentence#

Join the pieces with &, and wrap each number or date in TEXT. To build a receipt line in D2:

Excel formula
=A2&" paid "&TEXT(C2,"$#,##0.00")&" on "&TEXT(B2,"mmm d, yyyy")

The result is Acme Corp paid $1,250.50 on Feb 3, 2025. Fill down (Windows: Ctrl+D; Mac: ⌘D) and every row gets the same style. Note the spaces inside " paid " and " on ": without them the words run together. For more on joining, see how to combine text in Excel.

You can combine TEXT with TEXTJOIN too. In Microsoft 365, =TEXTJOIN(", ",TRUE,TEXT(B2:B4,"mmm d")) gives Feb 3, Feb 14, Mar 1. The TEXTJOIN function guide covers its arguments.

TEXT vs Format Cells: which should you use?#

Use Format Cells when you only want a cell to look different, and TEXT when the formatted value must be part of text. Format Cells (Windows: Ctrl+1; Mac: ⌘1) changes the display but keeps the real number, so formulas still work with it. TEXT creates new text, so the result can't be added up or compared as a number.

That means you shouldn't use TEXT on a column you'll calculate with. If you already have, VALUE turns text back into a number: =VALUE("1250.50") returns 1250.5. A tip: the Custom category in Format Cells shows the codes Excel uses, so you can copy one into TEXT. For cell formats, see how to format numbers as currency and percent.

Format codes can vary by language and region#

TEXT's format codes depend on the language of your Excel and your regional settings. Some language versions use different letters for day, month and year; German Excel, for example, uses T for day and J for year. Many countries also swap the comma and the decimal point, so "#,##0.00" may need to be "#.##0,00".

This matters when you share files. A TEXT formula written in one language can show the wrong result for a colleague using another. If the value only needs to look right in a cell, Format Cells is safer, because it adapts to each person's settings.

TEXT and other text functions#

TEXT is the opposite of pulling text apart. If you need part of a formatted result, such as the year from a code like INV-2025-0042, use LEFT, RIGHT and MID, or FIND and SEARCH to locate a marker first. And when you build labels from names, such as "Sara joined on Feb 3, 2025", you may first need to split first and last names.

Practise it#

Practise TEXT and VALUE in a live spreadsheet. You'll see the raw date number appear, format dates and dollar amounts with TEXT, build a receipt sentence, and turn imported text digits back into real numbers with VALUE.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Build a receipt line like Acme Corp paid $1,250.50 on Feb 3, 2025. Click D2 and join the client in A2, " paid ", the amount in C2 formatted with TEXT, " on ", and the date in B2 formatted with TEXT.

fx
ABCDE
1
Client
Paid On
Amount
Receipt
2
Acme Corp
2/3/2025
1250.5
3
Brightline
2/14/2025
980
4
Cedar Health
3/1/2025
12400.75
5
Delta Freight
3/19/2025
315.2
6
7
8

Tip: Five pieces joined with &. The amount code is "$#,##0.00" and the date code is "mmm d, yyyy".

Practise this in a lesson

LessonTEXT and VALUE: numbers to text and backFormat dates and dollar amounts inside sentences with TEXT, and turn digits stored as text into real numbers with VALUE.Function guideTEXTJOINJoin cells with commas, spaces or semicolons using TEXTJOIN, and skip blanks automatically. Examples, pitfalls and a live exercise.

Frequently asked questions

What does the TEXT function do in Excel?

+

It converts a number or date into text using a format code you choose. =TEXT(C2,"$#,##0.00") turns 1250.5 into the text $1,250.50.

Why does my date show as a number when I join it with text?

+

Excel stores dates as numbers, and & joins the stored number. Wrap the date in TEXT: ="Paid on "&TEXT(B2,"mmm d, yyyy").

How do I show the day of the week from a date?

+

Use =TEXT(B2,"dddd") for the full name, such as Monday, or =TEXT(B2,"ddd") for the short name, such as Mon.

How do I add leading zeros to a number?

+

Use zeros in the format code, one per digit: =TEXT(A2,"00000") turns 42 into 00042. The result is text.

Why does my TEXT format code not work?

+

Format codes depend on the language of your Excel. Some language versions use different letters for day, month and year, and many countries swap the comma and the decimal point.

Sources

  • TEXT function - Microsoft Support
  • TEXTJOIN function - Microsoft Support

Written and checked by the ExcelReady Team. First published October 30, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. What does the TEXT function do?
  2. Why do numbers and dates look wrong when you join them to text?
  3. Excel TEXT function date format codes
  4. Number format codes for TEXT
  5. How to put numbers and dates inside a sentence
  6. TEXT vs Format Cells: which should you use?
  7. Format codes can vary by language and region
  8. TEXT and other text functions
  9. Practise it

Keep reading

Text· 7 min read

How to Split First and Last Names in Excel

To split a full name in Excel, use =TEXTBEFORE(A2," ") for the first name and =TEXTAFTER(A2," ",-1) for the last name, which also handles middle names. In Excel 2021 and older, use =LEFT(A2,FIND(" ",A2)-1) for the first name. For a one-off job, Data > Text to Columns or Flash Fill splits names without formulas.

Text· 6 min read

LEFT, RIGHT and MID in Excel: Pull Out Part of a Cell

LEFT, RIGHT and MID pull part of the text out of a cell. LEFT(text, num_chars) takes characters from the start, RIGHT(text, num_chars) takes them from the end, and MID(text, start_num, num_chars) takes them from any position. For TX-ELC-40512, LEFT(A2,2) gives TX, MID(A2,4,3) gives ELC and RIGHT(A2,5) gives 40512.

Text· 7 min read

Find the Position of Text in a Cell (FIND and SEARCH)

FIND and SEARCH return the position of some text inside a cell, as a number. =FIND(" ",A2) gives 5 for Dana Whitfield, because the space is the 5th character. FIND is case-sensitive; SEARCH ignores capitals and allows wildcards. Both return #VALUE! when the text isn't there, so wrap them in ISNUMBER to test whether a cell contains a word.

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback. The first lessons are free, with no download.

Start learning for free