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

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
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

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]24[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]2[/TD]

</tbody>
Sheet12




[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<tbody>[TR="bgcolor: #DAE7F5"]
[TH]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]E24[/TH]
[TD="align: left"]="" & D24 & ""[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]




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?

[TABLE="width: 143"]
<tbody>[TR]
[TD="align: left"]*1096045508‬[/TD]
[/TR]
[TR]
[TD="align: left"]*1559772594‬[/TD]
[/TR]
[TR]
[TD="align: left"]*1580657761‬[/TD]
[/TR]
[TR]
[TD="align: left"]*1823876416‬[/TD]
[/TR]
</tbody>[/TABLE]
 
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?

[TABLE="width: 143"]
<tbody>[TR]
[TD="align: left"]*1096045508‬[/TD]
[/TR]
[TR]
[TD="align: left"]*1559772594‬[/TD]
[/TR]
[TR]
[TD="align: left"]*1580657761‬[/TD]
[/TR]
[TR]
[TD="align: left"]*1823876416‬[/TD]
[/TR]
</tbody>[/TABLE]


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,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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