Text

Google Sheets TEXT Function — Syntax, Examples & Tips

Learn how to use the TEXT function in Google Sheets to format numbers, dates, and times as readable strings. Includes syntax, format codes, and examples.

Syntax
=TEXT(number, format)

What TEXT Does

The TEXT function converts a number, date, or time into formatted text using a pattern you specify. It is the bridge between raw data and human-readable output — letting you display currency with symbols, dates in any format, percentages with specific decimal places, and more. The result is always a text string, which means it cannot be used in further arithmetic without converting it back.

Syntax

=TEXT(number, format)
ParameterDescription
numberThe numeric value, date, or cell reference to format.
formatA format pattern string enclosed in quotes.

Common format codes

CodeMeaningExample output
"0"Digit (shows zero if absent)TEXT(5, "000")005
"#"Digit (omits if absent)TEXT(5, "###")5
"#,##0"Thousands separatorTEXT(42000, "#,##0")42,000
"$#,##0.00"CurrencyTEXT(1250, "$#,##0.00")$1,250.00
"0.0%"PercentageTEXT(0.875, "0.0%")87.5%
"YYYY-MM-DD"ISO dateTEXT(A1, "YYYY-MM-DD")2026-04-05
"MMMM D, YYYY"Long dateTEXT(A1, "MMMM D, YYYY")April 5, 2026
"HH:MM AM/PM"12-hour timeTEXT(A1, "HH:MM AM/PM")02:30 PM

Basic Examples

Format a number as currency

AB
1AmountFormatted
21499.5=TEXT(A2, "$#,##0.00")

Result in B2: $1,499.50

Display a date in a specific format

AB
1DateReadable
24/5/2026=TEXT(A2, "MMMM D, YYYY")

Result in B2: April 5, 2026

Show a percentage with one decimal

AB
1RateDisplay
20.0823=TEXT(A2, "0.0%")

Result in B2: 8.2%

Advanced Examples

Build a readable summary sentence

Combine TEXT with concatenation to create dynamic sentences:

="Revenue for " & TEXT(A2, "MMMM YYYY") & " was " & TEXT(B2, "$#,##0") & ", up " & TEXT(C2, "0.0%") & " from last month."

For A2 = 4/1/2026, B2 = 84500, C2 = 0.12, this produces:

Revenue for April 2026 was $84,500, up 12.0% from last month.

This is especially useful for dashboard labels and report headers that need to update automatically.

Pad numbers with leading zeros

If you are working with ZIP codes, employee IDs, or invoice numbers that need a fixed width:

=TEXT(A2, "00000")

For A2 = 725, this returns 00725. Without TEXT, Google Sheets would strip the leading zeros since it treats the value as a number.

Common Mistakes

  • Using the TEXT result in calculations. TEXT returns a string, not a number. =TEXT(100, "$#,##0") + 50 will produce an error. Keep the raw numbers for math and use TEXT only for display purposes.
  • Mixing up format codes for dates. "MM" is months, "mm" is minutes. Writing =TEXT(A1, "YYYY-mm-DD") when you mean a date will give unexpected results. Use uppercase M for months and lowercase m for minutes within time formats.
  • Forgetting locale differences. Format codes like "$#,##0.00" use the dollar sign literally. For other currencies, type the symbol directly: =TEXT(A1, "€#,##0.00"). The thousands and decimal separators follow the spreadsheet locale, not the format string.

SheetAI Tip

Don't want to memorize this syntax? With SheetAI, just type what you need in plain English and the formula is generated for you. Install SheetAI to try it free.

Skip the formula. Describe what you need.

SheetAI lets you type what you want in plain English and generates the perfect formula — no syntax to memorize.

Try SheetAI Free