SheetsLessons
Text function

TEXT function in Google Sheets

TEXT turns a number or a date into text with exactly the formatting you choose: month names, weekday names, currency, percentages, padded IDs. You need it whenever a formatted value goes into a sentence or label, because joining a date or a number with & otherwise drops its formatting.

Syntax

=TEXT(number, format)
number
The number or date to format.
format
The pattern, in quotes, such as "mmmm d, yyyy", "dddd" or "$#,##0.00".

Practice TEXT

Task 1 of 5

Show the full month name (like "March") of the first sale date. Answer in C2.

C2
fx

Tip: while typing a formula, click a cell or drag across cells to insert references. Press Enter to check, and Tab to accept a function suggestion.

TEXT examples

Each example below runs against this sample sheet. The results are calculated by the same engine as the practice grid.

ABCD
1InvoiceDateAmountTax rate
2423/5/2026$1,234.507.5%
3711/20/2026$98.0020%
413057/1/2026$25,000.0012.5%
Invoices
FormulaResultWhat it shows
=TEXT(B2, "mmmm d, yyyy")March 5, 2026A long date.
=TEXT(B2, "dddd")ThursdayThe weekday name.
=TEXT(B2, "mmm yy")Mar 26A short month and year.
=TEXT(B2, "yyyy-mm-dd")2026-03-05An ISO date, handy for file names and sortable text.
="Due "&B2Due 46086Without TEXT, joining a date shows its serial number.
="Due "&TEXT(B2, "mmm d")Due Mar 5With TEXT, it reads properly.
=TEXT(C2, "$#,##0.00")$1,234.50Currency with a thousands separator.
=TEXT(D2, "0.0%")7.5%A percentage with one decimal.
="INV-"&TEXT(A2, "00000")INV-00042Zero-padded ID numbers.
=TEXT(C2, "#,##0.00;(#,##0.00)")1,234.50A second section sets the format for negative numbers.

TEXT format codes

CodeMeansExample result
d, ddDay of the month, without or with a leading zero5, 05
ddd, ddddWeekday name, short or fullThu, Thursday
m, mmMonth number3, 03
mmm, mmmmMonth name, short or fullMar, March
yy, yyyyYear26, 2026
h, hh, mm, ssHours, minutes (an m after h means minutes), seconds2:05
AM/PM12-hour clock2:05 PM
0A digit that is always shown (pads with zeros)000 → 007
#A digit shown only if needed#.## → 1.5
,Thousands separator#,##0 → 1,235
%Multiply by 100 and add %0% → 8%
;Separates the positive and negative formats0;(0) → (5)

Tips and common mistakes

  • The result is text. It looks like a number or a date but won't sum, sort or compare as one. Keep the original value for calculations.
  • To change how a cell looks without changing its value, use Format › Number instead of TEXT.
  • "m" means month unless it follows an hour (h) or comes before seconds (ss), in which case it means minutes.
  • Format codes in Sheets follow the spreadsheet's locale for month and day names.

Related functions