Help! Can't change this text to numbers for the life of me

aznvtb

New Member
Joined
Jun 5, 2009
Messages
17
The text in column A won't format as numbers. I've tried formatting it as number, using value() formula, copying/pasting with multiplication formula. Nothing is working unless i retype the number over itself. Any clue as to why this is and what a solution is? There are no empty spaces. This is an output from another formula.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Hi,

You mentioned this is the output from a formula.


Without seeing exactly what your data is / formula is, this is a best guess but..

If you've put a formula that outputs as text, no amount of formatting is going to work because it's not a VALUE that's being formatted, it's a FORMULA.. and the FORMULA OUTPUT (as text) takes priority/wins over cell formatting.

i.e.

Excel 2010
DE
2422

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet12




Worksheet Formulas
CellFormula
E24="" & D24 & ""

<tbody>
</tbody>

<tbody>
</tbody>




In cell D24 is the value 2

In cell E24 is a FORMULA.

The formula is ="" & D24 & ""


This means the formula is displaying text.

No matter how much I try to format that via the cell, or copy and multiply.. what's being copied and multiplied is not a text value of 2... it's the formula ="" & D24 & ""


Hope that helps?!
 
Last edited:
Upvote 0
Thanks. It isn't a formula, just straight text or some weird formatting. Actually, if you copy the numbers below by double clicking on the number and pasting into excel it does the exact same thing (don't match destination formatting). If you highlight manually it works. Any clue why?

*1096045508‬
*1559772594‬
*1580657761‬
*1823876416‬

<tbody>
</tbody>
 
Last edited:
Upvote 0
Not sure if this will work for you, but any time I've had trouble with numbers wanting to format as text, I just multiply by 1 (or add 0)...for instance...

=(your formula completely wrapped in parenthesis) *1
 
Upvote 0
Thanks. It isn't a formula, just straight text or some weird formatting. Actually, if you copy the numbers below by double clicking on the number and pasting into excel it does the exact same thing (don't match destination formatting). If you highlight manually it works. Any clue why?

*1096045508‬
*1559772594‬
*1580657761‬
*1823876416‬

<tbody>
</tbody>


Ah!

Following your instructions... clicking on a number and then pasting into Excel does something interesting!

I think it's because Excel doesn't know what it is (because it contains some kind of additional formatting)...

You're not actually pasting a number... you're pasting some kind of HTML/Unicode information.


So.. as Excel doesn't know what to do with it.. it adds a little extra info.

What you see displayed in the cell is NOT what's actually IN the cell.



I used the following code



Sub test()


Dim x As Range
Dim y As Range



Set x = Sheets("Sheet12").Range("A1")
Set y = Sheets("Sheet12").Range("B1")

Debug.Print "Pasted: " & x.Value2
Debug.Print "Manual: " & y.Value2


End Sub



When you run it, it shows the following output:

Pasted: 1096045508?
Manual: 1096045508



NOTICE THE ADDITIONAL QUESTION MARK



It's easy to see, now, that what's IN the cell where you pasted the data is not actually a number.. but some kind of "variant" data type that isn't really text as such. It defies functions that work on TEXT (even though ISTEXT shows TRUE!)

Another way you can tell this has happened is if you:

Click on the PASTED DATA cell and press F2 to edit.

Press the backspace key ONCE

Notice NONE of the number has been deleted... the "invisible" question mark has just been deleted!


Here's another way of looking at it:

Double click on the number.
Go to Excel to paste.
Select a cell
Use PASTE SPECIAL.


You get one of three options
HTML (Default, I think)
Unicode
Text (without formatting)


If you use Text - it appears WITH the question mark.

If you use HTML.. you don' t see the question mark because (I assume) this is Excel's way of saying "This is HTML and you don't want that extra bit seen" (i.e. it's about presentation, not numerical data)




Simple to fix, now we know it's got an extra bit of info.


Assuming your data is in column A, starting at row 2

in B2 enter

=LEFT(A2,LEN(A2)-1)


This will still be a text value.


From here, because it no longer has that question mark, you can perform the normal calculations on it.. like copy/paste special - multiply, or the =VALUE() function, and so on....

Hope that helps!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,386
Messages
6,124,628
Members
449,176
Latest member
Dazjlbb

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top