Text function
TEXT function in Google Sheets and Excel
TEXT turns a number or date into text in the format you choose, such as $1,234.50, 25% or Mon 2 Mar.
Checked against Microsoft's and Google's documentation on · Example calculated on a live sheet
- Excel 2016
- Excel 2019
- Excel 2021
- Excel 2024
- Microsoft 365
- Google Sheets
Syntax
TEXT(value, format_text)Arguments in [brackets] are optional. Google Sheets writes it TEXT(number, format).
Example
=TEXT(G2,"$#,##0.00") reads: Turn the price in G2 (34) into the text $34.00, with a dollar sign, a thousands separator and two decimals.
| A | B | C | D | E | F | G | H | I | |
|---|---|---|---|---|---|---|---|---|---|
| 1 | Order | Date | Customer | Product | Category | Qty | Price | Status | Price text |
| 2 | 1001 | 2 Mar 2026 | Mara Okafor | Monstera | Plants | 1 | $34.00 | Shipped | $34.00 |
| 3 | 1002 | 2 Mar 2026 | Jonas Lind | Terracotta pot | Pots | 3 | $12.50 | Shipped | |
| 4 | 1003 | 3 Mar 2026 | Priya Raman | Snake plant | Plants | 2 | $22.00 | Shipped | |
| 5 | 1004 | 4 Mar 2026 | Tomás Ruiz | Watering can | Tools | 1 | $18.00 | Pending | |
| 6 | 1005 | 5 Mar 2026 | Elif Demir | Fern | Plants | 4 | $9.50 | Shipped | |
| 7 | 1006 | 5 Mar 2026 | Mara Okafor | Potting mix | Soil | 2 | $7.25 | Returned | |
| 8 | 1007 | 6 Mar 2026 | Kenji Mori | Pruning shears | Tools | 1 | $24.00 | Shipped | |
| 9 | 1008 | 7 Mar 2026 | Ines Varga | Ceramic pot | Pots | 2 | $19.00 | Pending | |
| 10 | 1009 | 8 Mar 2026 | Jonas Lind | Monstera | Plants | 1 | $34.00 | Shipped | |
| 11 | 1010 | 9 Mar 2026 | Sofia Rossi | Fern | Plants | 6 | $9.50 | Shipped | |
| 12 | 1011 | 10 Mar 2026 | Priya Raman | Potting mix | Soil | 5 | $7.25 | Shipped | |
| 13 | 1012 | 11 Mar 2026 | Leo Brandt | Snake plant | Plants | 1 | $22.00 | Pending |
I2 shows $34.00 as text: the Monstera's price, formatted.
How the spreadsheet calculates it
Turns G2 into text shown with the format code "$#,##0.00".
- 1. TEXT: Turns
G2into text shown with the format code"$#,##0.00".value=`G2`: the number to formatformat=`"$#,##0.00"`: a format code in quotes or `"0%"`
More TEXT examples
=TEXT(B2,"mmmm")The month name of a date: March.=TEXT(B2,"ddd d mmm")A short date with the weekday: Mon 2 Mar.="Total: "&TEXT(SUM(I2:I13),"$#,##0.00")A sentence with a formatted total.=TEXT(A2,"00000")A number padded to five digits: 00419.=TEXT(D2/C2,"0.0%")A ratio as a percentage with one decimal.
Paste any of these into the formula explainer to see it step by step.
Tips
- Keep the original number in its own cell for maths; use TEXT only for display.
- Prefer cell formatting when the number just needs to look right in its own cell.
- Copy format codes from the cell's custom number format; most codes work in TEXT too.
What TEXT is used for
Labels and sentences in reports and dashboards ("Sales up 12.5% in March"), file names and IDs with leading zeros, weekday and month names from dates, and exports where another system needs a fixed date format.
Arguments
| Argument | Required | What it is |
|---|---|---|
| value | Yes | The number or date to format, such as G2 or a calculation. |
| format_text | Yes | The format code in quotes: "$#,##0.00" for money, "0%" for a percentage, "dd/mm/yyyy" or "mmmm" for dates, "00000" for leading zeros.Watch out: Microsoft notes that TEXT is language-specific: date codes such as "yyyy" can be different letters in other language versions. |
Common mistakes
Calculating with TEXT's result: it's text now. Keep the original number for maths.
Forgetting the quotes around the format code.
Joining a number into a sentence without TEXT:
="Total: "&I2shows the raw number with every decimal instead of a tidy $34.50.Writing "mm" for the month right after hours: next to h it means minutes. Use "mmm" or "mmmm" for month names.
In Google Sheets
Google Sheets has TEXT with the same two arguments, written TEXT(number, format), and the common codes such as "0.00", "0%" and "mmmm". We haven't checked every code in both apps, so test unusual ones in your file.
Errors you may see with TEXT
- #NAME?: A format code typed without quotes, like `=TEXT(B2,mmmm)`: unquoted letters are read as a name.
Questions
How do I show a date as a month name?
Use "mmmm" for the full name or "mmm" for three letters: =TEXT(B2,"mmmm") turns 2 Mar 2026 into March.
How do I keep leading zeros?
Give the code as many zeros as the length you want: =TEXT(A2,"00000") turns 419 into 00419.
How do I put a formatted number in a sentence?
Join TEXT's result with &: ="Total: "&TEXT(SUM(I2:I13),"$#,##0.00"). See the TEXT function guide for more codes.
How do I show a percentage with one decimal?
Use "0.0%": =TEXT(D2/C2,"0.0%"). TEXT multiplies by 100 and adds the % sign, as cell formatting does.
Sources
Official documentation the facts on this page were checked against.