The TEXT function
Formats a number as text with a number format code, for example to put it inside a sentence.
Syntax
TEXT(value, format_text)- value
- The number or date to format.
- format_text
- A format code in quotes, such as "0%", "00000" or "dd-mm-yyyy".
Examples
B1
=TEXT(10.25,2"0%")| A | B | |
|---|---|---|
| 1 | 25% |
In plain words: Show 10.25 2as a percentage with no decimals.
B1=TEXT(42,"00000")
| A | B | |
|---|---|---|
| 1 | 00042 |
B1=TEXT(1234.5,"#,##0.00")
| A | B | |
|---|---|---|
| 1 | 1,234.50 |
B1=TEXT(DATE(2024,3,5),"dd-mm-yyyy")
| A | B | |
|---|---|---|
| 1 | 05-03-2024 |
Read the guide
Questions
Why does TEXT give a different result in Danish Excel?
Format codes follow the language of Excel. Danish Excel swaps the thousands and decimal separators and uses å for year, so "dd-mm-yyyy" is written "dd-mm-åååå".