The purpose of the TEXT function is to convert a number to text using a specified format code.

TEXT is most often used to control the formatting of a number embedded into a text string.

Table of Contents

Syntax and example

The TEXT function takes two arguments,valueandformat_text.

TEXT function date example

Why do we need the TEXT function?

Why do we need the TEXT function?

Can’t we just apply Excel’s built-in number formatting to format numbers in a worksheet?

TEXT function date example

Keeping the number allows it to be used in standard numeric calculations.

The TEXT function, by contrast, actuallyconvertsa number to text.

The result istext, so numbers returned by TEXTcan’t be used in numeric calculations.

TEXT function date example

However, there are still many situations where TEXT is quite helpful.

The formatting is not available during concatenation.

The result is shown after the “//” marker.

TEXT function date example

TEXT with times

TEXT can format times as well as dates.

Then we use theRIGHT functionto extract just the two characters to the right, which are minutes.

The TEXT provides an elegant way to do this in a simple formula.

TEXT function date example

For a detailed explanation of how this formula works,see this page.

The TEXT function can do the same thing, and is much more versatile.

The FIXED function can be useful when concatenating a formatted number text.

TEXT function time example

TEXT function percentage example

Example of the TEXT function in another formula

Excel formula: Increment a number in a text string

Excel formula: List nth weekdays of the month

Excel formula: Create date range from two dates

Excel formula: Get first entry by month and year

Excel formula: Zodiac sign lookup

Excel formula: Highlight dates in same month and year

Excel formula: Get next day of week

Excel formula: Get month name from date

Excel formula: Add leading zeros to numbers

Excel formula: Pad a number with zeros

Excel formula: Sum by month

Excel formula: Convert date to text

Excel formula: List upcoming birthdays

Excel formula: Date is same month and year

Excel formula: Sum by weekday

Article image

Article image

Article image

Article image

Article image

Excel DOLLAR function

Excel FIXED function

TEXT function date example

TEXT function time example

TEXT function percentage example

Example of the TEXT function in another formula