ShareYourGroupShareYourGroupGoogle Sheets

Text

TEXT function in Google Sheets

TEXT turns a number or a date into text in the format you choose.

When a number or a date is joined into a sentence, it loses its formatting. A date turns into a five-digit number and an amount loses its commas. TEXT puts the format back by turning the value into text that looks the way you want.

Syntax

=TEXT(number, format)
ArgumentWhat it is
numberThe number or date to format.
formatA pattern in quotation marks, such as "0.00", "#,##0" or "dd-mmm-yyyy".

Examples

Sample sheet: Twelve sales made by four salespeople in three regions.
ABCDEF
1DateSalespersonRegionProductUnitsAmount
205-Jan-2026AshaNorthNotebook201200
312-Jan-2026RaviSouthPen50500
420-Jan-2026MeenaNorthBag43000
502-Feb-2026AshaEastPen30300
614-Feb-2026KabirSouthNotebook15900
728-Feb-2026RaviNorthBag21500
803-Mar-2026MeenaEastNotebook402400
915-Mar-2026AshaNorthBag32250
1022-Mar-2026KabirSouthPen60600
1101-Apr-2026RaviEastNotebook251500
1218-Apr-2026MeenaNorthPen80800
1306-May-2026AshaSouthBag53750

How it works

TEXT takes a value and a pattern. The patterns are those of Format, Number, Custom number format.

Number patterns

Pattern1234.5 becomes
"0"1235
"0.00"1234.50
"#,##0"1,235
"#,##0.00"1,234.50
"0%"123450%
"00000"01235

0 always shows a digit. # shows one only when it exists.

Date and time patterns

PatternGives
d, ddday: 5, 05
ddd, ddddMon, Monday
m, mmmonth number: 1, 01
mmm, mmmmJan, January
yy, yyyy26, 2026
hh:mmhours and minutes
hh:mm am/pmon a 12-hour clock

The result is text

TEXT output cannot be added up, and it sorts as text. So:

Where Sheets users need it

Dates inside QUERY. A QUERY condition wants a date written as date 'yyyy-mm-dd'. With the date in H1:

"where A >= date '"&TEXT(H1, "yyyy-mm-dd")&"'"

Grouping by month. =TEXT(A2, "yyyy-mm") gives a key such as 2026-01 that sorts correctly and keeps the years apart.

Labels and messages. ="Report for "&TEXT(TODAY(), "mmmm yyyy").

Fixed-width codes. ="INV-"&TEXT(B2, "0000").

A whole column. In ARRAYFORMULA: =ARRAYFORMULA(IF(A2:A="", "", TEXT(A2:A, "ddd d mmm"))).

Locale

Month and day names appear in the language of the spreadsheet's locale, set under File, Settings. The same formula shows "January" in an English locale and the local word in another. The decimal and thousands marks follow the locale too.

Sheets has a related function, TO_TEXT, which converts a value to text using whatever format the cell already has.

Common mistakes

In Excel

TEXT is the same in Excel, with the same common patterns.

Related functions

The results on this page were worked out by us from the sample sheet; they were not produced by a script running Google Sheets. If Sheets shows you something different, please tell us.

This is an independent help site. It is not connected with or approved by Google. Google Sheets is a trademark of Google LLC, named here only to say which program a formula is for. The people and figures in the sample sheets are made up.