TEXT in Excel: what it does and how to use it

TEXT turns a number or a date into text. You describe the layout you want with a pattern. Use mmmm for the month name, or 0.00 for two decimal places.

Syntax

TEXT(value, format_text)

When to use it

Getting the month name out of a date. Showing a number with a fixed number of decimal places inside a sentence. Building a label that mixes words and numbers.

What trips people up

What comes back is text, not a number, so it can no longer be added up or sorted by date. Use it for display, and keep the real value in its own column.

Watch it built, step by step

Questions

Why does TEXT(A2,"yyyy") not work on my computer?

The format codes follow the language Excel runs in. A German Excel expects "JJJJ" for the year and a French one "aaaa".

Why will the result not add up?

TEXT always returns text. Keep the original value for any calculation and use TEXT only for what is shown.

How do I show the day of the week?

=TEXT(A2,"dddd") gives Monday; "ddd" gives Mon.

Related functions

Settings: separator, Excel version

Argument separator

Set by your computer's language, not by the file. A frequent cause of a correct-looking formula being rejected.

Excel version

XLOOKUP, IFS, TEXTBEFORE and TEXTJOIN need Microsoft 365 or 2021; older versions return #NAME? instead. Choosing the older one switches every walkthrough to a formula that works there.