In this article we will show you how to use the Excel TEXT function which will help you convert numerical values into text. We'll explain what it does and go over some examples step by step.
TEXT()
function is a feature that is available Excel 2016, Excel 2013, Excel 2010, Excel 2007, Excel 2003 and even lower versions.Microsoft Excel is mostly about numbers, and most of the time you'll be working with numbers in your worksheets. There are times, when you need to convert numerical values into text or string, and so, in this case, the TEXT()
function is useful.
The formula syntax for the TEXT()
function is as follows:
TEXT( VAL, FORMAT )
The two arguments means:
Cell Value- This argument refers to a numerical value to be converted into text. It could be a date, number, reference to a cell that holds a numerical value or some other function which returns the number or date.
Text Format - This argument refers to template you wants to apply for. It is included in the quotation marks in the context of a format tag "mm / dd / yy''.
The Text formula can be used in:
NOTE: In Excel the TEXT feature converts a numerical value to a text string. In other equations, however, you would not be able to use the output of your Text formula.
As you observed, the TEXT function syntax is very simple, with a tough part including a proper format code that will output the number as you like. The TEXT method generally allows most of the format codes that are used in the Excel number formats.
0 - Digit placeholder which displays irrelevant zeros.
Example:
#.000
- it displays three decimal place.
If you're going to type 1.7 in the reference cell then, it shows a 1.700 results.
# This digit placeholder wouldn't display any extra zeros.
Example:
#.###
- It displays up to three decimal places.
If you're going to type the 1.7 in the reference cell then, it displays as 1.7, however if you type 1.77777, it would displays as 1.78.
? - It refers to digit placeholder which leaves space for insignificant zeros but do not display them. The column numbers are usually matched at a decimal point.
Example:
#.?? - It displays a maximum of two decimal places in a column and aligns the decimal points.
Comma (,) - Refers to a thousands operator.
Period (.) - Refers to a decimal point.
The section will show you the different format codes used in the TEXT function. The TEXT()
function allows you to change the appearance of a number by applying formatting codes to it.
You can also include in the format code some of the following characters and they will be displayed in the same way as entered:
+
and -
()
:
'
&
~
^
)You can use any of the following format codes below when using the TEXT()
function with data and time temporal values in Excel:
To demonstrate the following format codes, let's create an example.
Supposed the original date is 06/14/2010.
This are the result for the following Text function:
= TEXT(A2, "mmm dd yyyy")
Formatted date Jun 14 2010
=TEXT(A2, "d-mmm-yy")
Formatted date 6-Jun-10
=TEXT(A2, "ddd")
Formatted date sunday
=TEXT(A2, "ddd dd mmmm, yyyy")
Formatted date Sunday 14 June, 2010
We hope these examples have given you a greater understanding of the Excel TEXT function. It is a function that comes up extremely often and it's good to know by heart. Thank you for joining us!