TEXT Formula returns a value converted to text with a specified format on the base of given parameters.
Syntax of TEXT formula:
TEXT( value, format )
Parameters:
- value: The value to convert to text.
- format : The format used to display the result.
Below are the useful format types:
| Format Type | Details |
|---|---|
| 0 | Forces the display of a digit in its place |
| # | Display digit if it adds to the accuracy of the number (but don't display if a leading zero or a zero at the end of a decimal) |
| . | Defines the position that the decimal place takes |
| d | Day of the month or day of week |
| d = one or two digit representation (e.g. 1, 12) | |
| dd = 2 digit representation (e.g. 01, 12) | |
| ddd = abbreviated day of week (e.g. Mon, Tue) | |
| dddd = full name of day of week (e.g. Monday, Tuesday) | |
| m | Month (when used as part of a date) |
| m = one or two digit representation (e.g. 1, 12) | |
| mm = two digit representation (e.g. 01, 12) | |
| mmm = abbreviated month name (e.g. Jan, Dec) | |
| mmmm = full name of month (e.g. January, December) | |
| y | Year |
| yy = 2-digit representation of year(e.g. 99, 08) | |
| yyyy = 4-digit representation of year(e.g. 1999, 2008) | |
| h | Hour |
| h = one or two digit representation (e.g. 1, 20) | |
| h = two digit representation (e.g. 01, 20) | |
| m | Minute (when used as a part of a time) |
| m = one or two digit representation (e.g. 1, 55) | |
| m = two digit representation (e.g. 01, 55) | |
| s | Second |
| s = one or two digit representation (e.g. 1, 45) | |
| ss = two digit representation (e.g. 01, 45) | |
| AM/PM | Indicates that a time should be represented using a 12-hour clock, followed by "AM" or "PM" |
Returns
The TEXT function returns a string/text value.
