Sub topic 12
Numbers that stay text after cleaning
This chapter assumes you can enter and copy formulas, use relative references such as A2, and tell text from numbers in a cell. It also assumes you have already built a cleaning formula from TRIM, CLEAN, and SUBSTITUTE.
Why cleaned numbers can still be text
TRIM, CLEAN, and PROPER all return text. If A2 holds the imported value " 1,250 ", then =TRIM(A2) returns 1,250. It looks clean, but Excel still treats it as text. Sums skip it, lookups against real numbers fail, and sorting puts it in the wrong place.
Two signs give it away:
- The value is left-aligned. Numbers align right by default.
- A small green triangle may appear in the corner, with the message "Number stored as text".
Cleaning does not fix this by itself. It only removes the spaces and hidden characters that stopped Excel from reading the value as a number.
Checking what you have
Use ISTEXT and ISNUMBER to test a cell directly.
=ISNUMBER(B2)This returns TRUE only when B2 holds a real number. Use =ISTEXT(B2) for the opposite test. Both are more reliable than judging by alignment, because a cell can be right-aligned by formatting while still holding text.
Converting with VALUE
VALUE turns text that looks like a number into a number. Wrap it around the cleaning formula so both steps happen together.
=VALUE(TRIM(CLEAN(SUBSTITUTE(A2,CHAR(160)," "))))The order matters. SUBSTITUTE turns non-breaking spaces into normal spaces, CLEAN removes control characters, TRIM removes extra spaces, and VALUE converts what is left. If any invisible character survives, VALUE returns a #VALUE! error. That error is useful, because it tells you the cell still has a hidden character. Use =UNICODE(RIGHT(A2,1)) to find it.
A shorter alternative is to force a conversion with arithmetic.
=TRIM(A2)*1Multiplying by 1 makes Excel read the text as a number. Adding zero or using a double negative (--TRIM(A2)) behaves the same way. VALUE states the intent more clearly, so it is easier for others to read.
Dates and regional settings
Text that looks like a date can be converted the same way, but the result depends on your regional settings. VALUE reads "03/04/2026" as 4 March in a day-first locale and as 3 April in a month-first locale. A thousands separator or decimal mark that does not match your locale also causes #VALUE! or a wrong number. Check a few converted values against the source before trusting the whole column.
Order of the final steps
The usual workflow has three stages.
- Clean and convert in a helper column.
- Copy the helper column and use Paste Special, then Values, to replace formulas with static results.
- Apply a number or date format to the converted cells.
Do the conversion before you paste values. Pasted text stays text, so you would have to convert it again.
Common mistakes
| Mistake | Result | Fix |
|---|---|---|
| Using PROPER or TRIM and expecting a number | Value stays text | Wrap in VALUE |
| Pasting values before converting | Text is frozen as text | Convert first, then paste |
| Converting ZIP codes | Leading zeros lost | Leave as text |
| Ignoring `#VALUE!` | Hidden character remains | Check with UNICODE |
Exercise
Cell A2 holds the imported text "1 250" where the gap is a non-breaking space. Write a formula that returns the real number 1250, and explain why =TRIM(A2) alone is not enough.
Show answer
Use =VALUE(TRIM(SUBSTITUTE(A2,CHAR(160),""))). TRIM does not remove a non-breaking space (character 160), and it returns text even when it succeeds. SUBSTITUTE removes the character 160 so the digits join, and VALUE converts the result to a number. If you replace character 160 with a normal space instead of an empty string, the result is "1 250", which VALUE cannot convert because the space sits between digits.
Exercise
A column of cleaned values is left-aligned, and =ISNUMBER(B2) returns FALSE. Name two ways to convert it without formulas in a new column, and one case where you should not convert at all.
Show answer
Use Text to Columns on the column and choose Finish, or enter 1 in a spare cell, copy it, and use Paste Special with Multiply on the values. Do not convert identifiers with leading zeros, such as ZIP codes or account numbers, because conversion drops the zeros.