What is the ‘TEXT’ function?
Like the ‘VALUE’ function, if we type ‘TEXT’ into a cell, the tooltip tells us that it:
“Converts a value to text in a specific number format”
The syntax for the ‘TEXT’ function is:
Note the function has two arguments – and both are required.
The ‘value’ argument is the value that we want to convert – or the cell reference that contains that value.
The ‘format_text’ argument is the format we want the function to output the new text our function will generate.
Now let’s say we want to use this value and plug it into the text string “Today’s date is…”.
To do this, we can type the following into cell ‘A3’ to see what happens:
What we actually get is not what we are really looking for.
Our date value in ‘A2’ actually appears in its number form in our newly created string in ‘A3’.
The value that appears when we attempt this, ‘42594’, is the numeric equivalent of the date value in ‘A2”.
This is not what we want so we need to put the ‘TEXT’ function to work.
We want the date to show in the exact same form as it appears in ‘A2’.
We need to state this in our ‘format_text’ argument by placing ‘mm/dd/yyyy’ in double quotes.
We can make this even better by choosing a different format.
Let’s take the original date value and convert it to long date form. That way it fits better into our sentence.
This time we do the same thing we did with our previous ‘TEXT’ function.
This time we will use “mmmm dd, yyyy” as our ‘format_text’ argument.
Note that ‘mmmm’ month format is the full month name as compared to ‘mmm’ for the three letter abbreviation of the same.
Now let’s insert our results from ‘B7’ into our sentence text string: