Convert a number to text with a number format
=TEXT(value, format_text)
| Parameter | Description |
|---|---|
value |
The number to convert. |
format_text |
The number format to use. |
Assume cell A1 contains the number 1500.35, and your goal is to display the number as "$1,500.35". You can do that by providing the number format "$#,
=TEXT(A1,"$#,##0.00") // returns "$150.35"
The TEXT function, by contrast, actually converts a number to text. The result is text, so numbers returned by TEXT can't be used in numeric calculati
="The date is "&A1 // returns "The date is 45585"
We end up with: "The date is 45585". Why? This happens because the date formatting applied to cell A1 is not part of the number, which is 45585 in Exc
="The date is "&TEXT(A1,"mmmm d, yyyy")
With the date October 21, 2024, in cell A1, the TEXT function can be used like this:
=TEXT(A1,"dd-mmm-yy") // returns"24-Oct-2024"
=TEXT(A1,"mmmm d") // returns "October 21"
The formulas used in column D are below. The result is shown after the "//" marker.
="The year is "&TEXT($B$5,"yyyy") // "The year is 2024"
="The month is "&TEXT($B$5,"mmmm") // "The month is October"
="The month is "&TEXT($B$5,"mmm") // "The month is Oct"
="The month is "&TEXT($B$5,"mm") // "The month is 10"
="The day is "&TEXT($B$5,"dddd") // "The day is Monday"
="The day is "&TEXT($B$5,"ddd") // "The day is Mon"
="The day is "&TEXT($B$5,"dd") // "The day is 21"
="The day is "&TEXT($B$5,"ddd, mmm d") // "The day is Mon, Oct 21"
TEXT can format times as well as dates. For example, with the time 3:15 PM in cell A1, the TEXT function can print the time in a 24-hour format like t
="The time is "&TEXT(A1,"hh:mm") // returns "The time is 15:00"