Features of !SEMTools

TEXT

TEXT function examples in Excel
Examples of the TEXT function in Excel
Function CategoryText
VolatilityNon-volatile
Related Functions

What Does This Function Do?

The TEXT function converts a number to text in a specified number format.

This can include dates, times and their fragments, financial units, percentages.

Conversion to custom user formats is also possible, which can be created based on existing ones.

The complete list of formats can be found using the Format Cells procedure. This procedure can be accessed through the context menu, which can be opened by right-clicking any cell.

Format Cells dialog in Excel

And then select the desired type from the list of number formats.

Number format selection in Excel

Syntax

=TEXT(number, format)

Formatting

No special formatting required.

Logical values are not converted to their numerical equivalents but become text.

Numbers formatted as text are treated as numbers.

Usage Examples

Example 1

To ensure correct sorting of numbers in text format, it may be necessary to add leading zeros to numbers to equalize their length.

The specialist used the TEXT formula with a custom format.

Adding leading zeros to numbers for uniform length
Adding leading zeros to numbers to ensure uniform length

Example 2

Customer phone numbers are stored in the database in normalized form, without any separators or symbols. For convenient manual calling from the database, the sales manager used a custom phone number format in the TEXT function.

Formatting phone numbers with TEXT function
Converting phone numbers to a readable format using the TEXT function in Excel

Like the article? Help its author! Buy !SEMTools, it has lots of useful instruments to process text data.

This post is also available in RU.