The TEXT function
TEXT turns a number or date into text that looks exactly how you want. Use it when you join a value into a sentence or label, because joining throws away the cell's own formatting.
Date codes: d, dd, ddd (Fri), dddd (Friday), m, mm, mmm (Mar), mmmm (March), yy, yyyy. Number codes: 0 for a digit, #,##0 for thousands commas, .00 for two decimal places, % for a percentage.
=TEXT(value, format_text)
Arguments
- value
- The number or date to format.
- format_text
- A format code in quote marks, such as
"dd/mm/yyyy","£#,##0.00"or"0%".
Try it
=TEXT(A2,"dddd d mmmm yyyy") in D2. The date is shown with the full day and month names: Friday 14 March 2025.
D2
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Invoice date | Amount | VAT rate | Long date | |
| 2 | 14 Mar 2025 | £1,250.50 | 17.5% | Friday 14 March 2025 | |
| 3 | |||||
| 4 | |||||
| 5 | |||||
| 6 |
Edit the formula in D2, or change the data, and press Enter.
More examples
| Formula | Result | What it does |
|---|---|---|
| =TEXT(B2,"£#,##0.00") | £1,250.50 | A pound sign, thousands comma and two decimal places. |
| =TEXT(A2,"mmm-yy") | Mar-25 | A short month and two-digit year, handy for grouping by month. |
| =TEXT(C2,"0.0%") | 17.5% | A percentage to one decimal place. |
| ="Due "&TEXT(A2+30,"d mmm") | Due 13 Apr | Add 30 days, then format the result inside a sentence. |
Tips
- Use TEXT whenever you join a date or amount with
&, CONCAT or TEXTJOIN, or it shows as a plain number. TEXT(A2,"dddd")gives the day of the week;TEXT(A2,"mmmm")gives the month name.- To keep a value as a number for sums, format the cell instead (Format Cells). TEXT is for display.
Common mistakes
- SUM ignores the formatted results.TEXT returns text, not a number. Keep a numeric column for calculations and use TEXT only for labels.
- Dates come out as 03/14/2025.You used the American order. For UK dates write
"dd/mm/yyyy". - The format code works on one computer but not another.Format codes follow the language of the spreadsheet app: in a German copy of Excel, for example, the year is JJJJ. Share the file with the code for that language, or format the cell instead.
Practise TEXT with instant feedback
Type real formulas into a working spreadsheet and get told straight away whether they work.