TEXT Function vs Number Format in Excel: Which to Use
By ExcelReady TeamUpdated 7 min read
The short answer
Use a number format when the cell must stay a number you can sum, sort or chart: it changes only the look. Use the TEXT function when the formatted look must sit inside text, such as "Invoice INV-1042 for $1,234.50" or an ID like EMP-00042. TEXT returns text, so keep the original number in its own cell.
Key takeaways
- A number format changes how a cell looks; the value underneath stays a number.
- TEXT returns text. SUM skips text results, so a column of TEXT formulas totals 0.
- Joining a number or date with & drops its format: a date becomes a serial number like 46461. Wrap it in TEXT.
- Format codes are mostly the same in both, such as $#,##0.00 and 00000, but TEXT codes are fixed text that other language versions of Excel may read differently.
- Best practice: keep the number in one cell and put TEXT in a separate label cell.
On this page+
The TEXT function vs number format choice is about what you need the cell to be. A number format only changes how a number looks, so it stays a number you can sum, sort and chart. The TEXT function produces text that looks formatted, which is what you need when a number or date goes inside a sentence, a label or an ID. This guide is for anyone building reports, invoices or exports, and for anyone practising for an Excel test where both come up.
TEXT function vs number format: the differences at a glance#
Both use the same kind of format codes, such as $#,##0.00. The difference is the result.
| Feature | Number format (Format Cells) | TEXT function |
|---|---|---|
| What you get | The same number, displayed differently | A new text value |
| Where it lives | On the cell itself | In a formula, usually in another cell |
| SUM, AVERAGE, charts | Work normally | SUM and AVERAGE skip the text |
| Sorting | By size | Character by character, like words |
Survives joining with & | No, the raw value is joined | Yes, that is its main job |
| Survives Paste Values | No, only the raw value is pasted | Yes, the text is the value |
Colours like [Red] | Yes | No, the result is plain text |
| Other language versions of Excel | Adapts automatically | Codes stay exactly as typed |
Microsoft's own advice on the TEXT function page matches this: keep the original value in one cell, and use TEXT in another.
The same invoices, formatted both ways#
Here are three invoices. Column B holds real numbers with a currency format. Column D turns the same amounts into text with =TEXT(B2,"$#,##0.00"), filled down.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Invoice | Amount (formatted) | Due date | Amount (TEXT) |
| 2 | INV-1041 | $950.00 | Feb 26, 2027 | $950.00 |
| 3 | INV-1042 | $1,234.50 | Mar 15, 2027 | $1,234.50 |
| 4 | INV-1043 | $12,000.00 | Mar 31, 2027 | $12,000.00 |
| 5 | Total | $14,184.50 | 0 |
Columns B and D look the same, but they behave differently:
=SUM(B2:B4)returns 14184.5, shown as $14,184.50.=SUM(D2:D4)returns 0. SUM ignores text in the cells it adds.=AVERAGE(D2:D4)returns #DIV/0!, because there are no numbers to average.=D2+D3returns 2184.5. The plus sign makes Excel convert number-like text back into numbers, so this one works on English (US) settings. That inconsistency is exactly why text numbers cause silent errors.- Sort column D from A to Z and $950.00 comes last, after both larger amounts. Text is compared character by character, and "9" comes after "1". Sort column B from smallest to largest and 950 comes first.
- By default, the numbers in B sit on the right of the cell and the text in D sits on the left. That is a quick visual clue that something is text.
Where TEXT wins: putting the amount in a sentence#
Now build a reminder line in E3. Joining the cells directly loses every format:
="Invoice "&A3&" for "&B3&" is due "&C3The result is Invoice INV-1042 for 1234.5 is due 46461. The & operator joins stored values: 1234.5 instead of $1,234.50, and the date's serial number instead of the date. Wrap each value in TEXT:
="Invoice "&A3&" for "&TEXT(B3,"$#,##0.00")&" is due "&TEXT(C3,"mmm d, yyyy")The result is Invoice INV-1042 for $1,234.50 is due Mar 15, 2027. The guide to TEXT format codes lists the date and number codes, and ampersand vs CONCATENATE compares the ways to join text.
When to use a number format#
Use a number format whenever the value is still data: something you will total, compare, sort, filter, chart or feed into another formula.
- Money and percentages in tables: select the cells and open Format Cells with Ctrl+1 on Windows or ⌘1 on a Mac, or use the buttons covered in formatting numbers as currency and percentages.
- Leading zeros for display: the custom format
00000shows 42 as 00042, and the cell is still the number 42. - Labels around a number: the custom format
"EMP-"00000shows EMP-00042, yet=A2+1still returns 43. - Negative numbers in red or brackets: only a number format can colour a cell.
Custom number formats explains the codes, including sections for positive, negative and zero values.
When to use the TEXT function#
Use TEXT when the formatted look has to become part of the value itself.
=TEXT(value, format_text)- Numbers or dates inside sentences, report titles and email lines, like the invoice reminder above.
- IDs and keys that other systems store as text:
=TEXT(A2,"00000")returns the text 00042. If a lookup list holds "00042" as text, a number 42 formatted as 00042 will not match it, but the TEXT result will. - Values that must keep their look when copied as values, or sent to tools that ignore Excel formats. Paste Special > Values drops number formats, and a Word mail merge can show 1234.5 instead of $1,234.50. A TEXT helper column fixes both; see Excel mail merge.
- Parts of a date:
=TEXT(C3,"dddd")returns Monday, and=TEXT(C3,"mmmm")returns March.
If you later need the number back, TEXT vs VALUE shows how VALUE reverses the conversion.
Edge cases and common mistakes#
These are the problems that show up in real files.
- Replacing the numbers with TEXT. If you overwrite column B with TEXT results, every total, chart and pivot built on it breaks. Keep the number and add TEXT next to it.
- Totals that quietly return 0. SUM over TEXT results gives 0 with no error message. Check that the cells hold numbers before you trust a total.
- Forgetting the quotes. The format code is text, so it needs double quotes:
TEXT(B3,"0.00"), notTEXT(B3,0.00). - Expecting TEXT to colour things. A code such as
[Red]changes colour only in a cell's number format. TEXT returns plain text. - Language and region differences. A TEXT format code is just text inside the formula, so Excel does not translate it. Microsoft notes that special formats vary by locale and that thousands separators depend on regional settings. German Excel, for example, uses J (Jahr) rather than y for years, so a
"yyyy"code written in English Excel may not work there. A cell number format adapts to the reader's settings automatically. - Rounding you can't see.
=TEXT(1.566675,"0.00")shows 1.57, but it is text now. If you need a rounded number, use ROUND, not TEXT.
What a job test usually checks#
Tests check the type of value in a cell as well as how it looks. If a task says "format column B as currency" and you replace the amounts with TEXT formulas, the cells look right but now hold text. A checker that reads the value, or a later task that asks for a total, will expose it.
When a task asks you to "create a label", "build a sentence" or "show the date in a message", it is testing TEXT, usually with &. The classic trap is joining a date without TEXT and getting a serial number like 46461. In interviews, a clear answer is: "Number formats change the look and keep a number; TEXT creates text, so I keep the original number for calculations."
How to decide: a quick checklist#
The first "yes" points to your answer.
- Will this cell be summed, averaged, sorted, filtered or charted? Yes: number format.
- Are you joining the number or date to words with
&, CONCAT or TEXTJOIN? Yes: TEXT. - Must the value match text in another list or system, like an ID with leading zeros? Yes: TEXT in a helper column.
- Do you need colours, or different looks for negative numbers? Yes: number format.
- Will people open the file in other language versions of Excel? Yes: prefer a number format, and test any TEXT codes.
- Does the task say "format" rather than "create text"? Yes: number format.
Our recommendation#
Store numbers and dates as real values and give them a number format. That covers most cells in most workbooks. Reach for TEXT only at the last step, when a value has to sit inside a sentence, label, ID or export, and put that TEXT formula in its own cell that points at the original.
If you follow that one rule, your totals keep working and your labels still look right.
Practise it#
Build the badge ID in the exercise on this page with "EMP-" and TEXT. Then try the TEXT and VALUE lesson, where you join payment dates and amounts into sentences and turn text digits back into numbers. The more formatting lesson covers comma style, date formats and resetting a cell to General, so you can change the look of a number without changing the number.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
Staff numbers are stored as real numbers in column A. Badge IDs must read like EMP-00042: the letters EMP, a hyphen, then the number padded to 5 digits. In C2, build the badge ID for A2 with TEXT.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Badge ID | |||
| 2 | Priya | |||
| 3 | Tom | |||
| 4 | Ana | |||
| 5 | Ken | |||
| 6 | ||||
| 7 | ||||
| 8 |
Tip: Join the text "EMP-" with & to TEXT(A2, "00000"). Each 0 in the code is one digit, so 42 becomes 00042.
Practise this in a lesson
Frequently asked questions
What is the difference between the TEXT function and Format Cells in Excel?
Format Cells changes only how a value is displayed, so the cell is still a number. The TEXT function creates a new text value that looks formatted, which you can join to words but can't sum or sort as a number.
Why does my number lose its format when I join it with &?
The & operator joins the stored value, not the displayed one. A cell showing $1,234.50 joins as 1234.5, and a date joins as its serial number. Wrap the cell in TEXT, such as TEXT(B3,"$#,##0.00"), to keep the look.
Why does SUM return 0 on my TEXT results?
TEXT returns text, and SUM ignores text in the cells it adds up. Total the original numbers instead, and use TEXT only for display.
How do I add leading zeros in Excel?
To only display them, apply the custom number format 00000 and the cell stays a number. To get real text such as 00042, for a lookup or an ID, use =TEXT(A2,"00000").
Can I turn a TEXT result back into a number?
Yes. VALUE converts number-like text back to a number, for example =VALUE("$1,000") returns 1000 on English (US) settings. It is better to point formulas at the original number in the first place.