How to Use the TEXT Function in Google Sheets | Format Numbers and Dates as Text
How to Use the TEXT Function
The TEXT function applies a specified number or date format to a value and outputs the result as a text string. It is essential when combining dates or currency amounts with other text, or when zero-padding numbers to a uniform length.
Syntax
=TEXT(number, format)
- number: The number, date, or cell reference to format (required).
- format: The format pattern enclosed in double quotes (required), such as
"yyyy/mm/dd (ddd)","$#,##0", or"0000".
Example Using a Table
Here is an example of converting dates and numbers into readable formatted text strings.
| Row | Column A (Date / Number) | Column B (Format) | Column C (TEXT Result) |
|---|---|---|---|
| 1 | Raw Data | Format | Formatted Result |
| 2 | 2026/11/22 | yyyy/mm/dd (ddd) |
=TEXT(A2, B2) → 2026/11/22 (Sun) |
| 3 | 125000 | $#,##0 |
=TEXT(A3, B3) → $125,000 |
| 4 | 45 | 0000 |
=TEXT(A4, B4) → 0045 |
- Formula:
=TEXT(A2, "yyyy/mm/dd (ddd)") - Result:
2026/11/22 (Sun)
Combining it with the concatenation operator (&)—such as ="Invoice Amount: " & TEXT(A3, "$#,##0")—lets you embed formatted values cleanly inside sentences.
Common Errors and Notes
- Forgetting Double Quotes Around
formatCauses Errors: The second argument must be passed as a string wrapped in". Omitting quotes causes#NAME?or#ERROR!. - Asterisks (
*) and Certain Format Codes Are Unsupported: In Google Sheets, including*or conditional color codes insideTEXTformat strings can trigger a#VALUE!error. - Output Is Always Text: Even if the result looks like a number or date, its data type is text, so it cannot be used directly for numeric comparisons or date arithmetic.
Frequently Asked Questions
Q. How do I extract only the day of the week from a date using TEXT?
A. Use "ddd" or "dddd" as the format. For example, "=TEXT(A2, "ddd")" returns "Sun" or "Mon", while "dddd" returns "Sunday" or "Monday" as text.
Q. Can I add numbers or use SUM on values converted with TEXT?
A. No, because TEXT returns a text string, functions like SUM will ignore it. Reference the original numeric cells for calculations, or convert back with VALUE first.