The TEXT function in Google Sheets is a powerful tool that allows users to convert numeric values into text format based on a specified pattern. This feature is particularly useful for formatting numbers, dates, and times in a way that aligns with specific presentation needs or data analysis requirements.
Syntax
TEXT(value, format_text)
- value: The numeric value you wish to convert into text.
- format_text: A text string that defines the format you want to apply to the value. This can include patterns for numbers, dates, and times.
Example #1
TEXT(1234.567, "$,0.00")
This function converts the number 1234.567 to a text format representing currency. The result would be “$1,234.57”.
Example #2
TEXT(TODAY(), "dd/mm/yyyy")
This example reformats the current date to a text format of day, month, and year. Assuming today is October 5, 2023, the result would be “05/10/2023.”
Example #3
TEXT(0.567, "0%")
By using this function, the decimal number 0.567 is converted into a percentage format. The resulting output will be “57.00%”.
Error handling
- VALUE! This error may occur if the input value is not a number or if the format string is not a valid format.
- N/A Indicates that the function could not find a reference or that the specified text format was invalid.
- REF! This happens if the referenced cell is deleted or not valid.