convert number stored as a text into number

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,805
Office Version
  1. 2016
Platform
  1. Windows
Hi
I watched a youtube channel and he covered the numbers below ( I created the same numbers) into number by copying number 1 and then PasteSpecial --> multiply. It did work and all numbers moved to the right hand side of the cells after that copy and pastespecial. But before I pastespecial, I tried it to create simple formula to add each of these number to 100. I got correct answer. My question, why I need to do the copy 1 then pasteSpacial-->multiple, when I can get the right answer without that step? Thank you very much.

 
Last edited:

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Because you will not always get the right answer. If you do a mathematical operation on a single cell it will work.
However in the example below you will see the SUM function in cell A5 didn't work. When I used the VALUE function or added each cell individually I get the right answer. If you had 200 numbers formatted as text you would not want to have to type in each cell.
Also, if you use a function like VLOOKUP and the lookup cell is text and the the value to lookup is entered as a number you will get an error.
Book1
ABCD
1Text
21Test1#N/A
32Test2Test2
43Test3
50
6
76
86
Sheet1
Cell Formulas
RangeFormula
D2D2=VLOOKUP(2,A2:B4,2,0)
D3D3=VLOOKUP("2",A2:B4,2,0)
A5A5=SUM(A2:A4)
A7A7=SUM(VALUE(A2:A4))
A8A8=A2+A3+A4
 
Upvote 0
The same as in #2 happens when it comes to VBA codes:
VBA Code:
Sub Fill999AndAdd100()
    Dim num As String
    num = "'999" 'A single quotation before the number thus outputted as a text string
    Range("A1") = num + 100 'Error: Type mismatch
    Range("A1") = Val(num) + 100 'No error
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,810
Messages
6,121,690
Members
449,048
Latest member
81jamesacct

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