formulastreak

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

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.

Leaf & Loam orders · edit I2 and watch it recalculate
Click a cell (or use the arrow keys) to insert its address · Enter shows the resultI2 = $34.00
ABCDEFGHI
1OrderDateCustomerProductCategoryQtyPriceStatusPrice text
210012 Mar 2026Mara OkaforMonsteraPlants1$34.00Shipped$34.00
310022 Mar 2026Jonas LindTerracotta potPots3$12.50Shipped
410033 Mar 2026Priya RamanSnake plantPlants2$22.00Shipped
510044 Mar 2026Tomás RuizWatering canTools1$18.00Pending
610055 Mar 2026Elif DemirFernPlants4$9.50Shipped
710065 Mar 2026Mara OkaforPotting mixSoil2$7.25Returned
810076 Mar 2026Kenji MoriPruning shearsTools1$24.00Shipped
910087 Mar 2026Ines VargaCeramic potPots2$19.00Pending
1010098 Mar 2026Jonas LindMonsteraPlants1$34.00Shipped
1110109 Mar 2026Sofia RossiFernPlants6$9.50Shipped
12101110 Mar 2026Priya RamanPotting mixSoil5$7.25Shipped
13101211 Mar 2026Leo BrandtSnake plantPlants1$22.00Pending

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. 1. TEXT: Turns G2 into text shown with the format code "$#,##0.00".
    • value = `G2`: the number to format
    • format = `"$#,##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

ArgumentRequiredWhat it is
valueYesThe number or date to format, such as G2 or a calculation.
format_textYesThe 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: "&I2 shows 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.

Practise TEXT on a live sheet

Lesson 25, Join text and TEXT() (Unit 6, Text and dates), has 5 graded exercises, checked instantly, with steps and hints when you're stuck. Pro