TEXT
Description
Converts the specified number into text, based on the specified format. Example:
Worksheets normally stores dates using their serial numbers for efficiency in
calculations; you can use the TEXT function to reformat the date as a user-readable
value.
Syntax
TEXT(
value
,
format_text
)
- value: The number to convert.
- format_text: The format to use when converting the number.
Format options:
0 | Display a digit. |
# | Display a digit if it increases number accuracy. Don't display a digit
if it is a leading zero or a zero at the end of a decimal. |
. | Specifies the position of the decimal. |
d | Day of month or day of week:
|
m | Month (when part of a date):
|
y | Year:
|
h | Hour:
|
m | Minute (when part of a time):
|
s | Second:
|
AM/PM | Represent time using a 12-hour clock, followed by "AM" or "PM". |
Example
Formula | Result |
|---|---|
=TEXT(A1, "mm/dd/yyyy") Where cell A1 contains 43210 . | 04/20/2018 |
=TEXT(A1, "dd/mm/yyyy") Where cell A1 contains 12/25/2017 . | 25/12/2017 |
=TEXT(A1, "0.0%") Where cell A1 contains 123.45678 . | 12345.7% |