Convert number in text format to number

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have downloaded a text file into Excel. The nos. are reflected as text and I am not able to perform sum function. eg. negative 4 is shown as 4-. How can I quickly convert it into numbers without having to go to each of them and key the - in front of the nos? I have tried reformat it to numbers to no avail
Thank yo
 
Set up another column and enter the formula: =value(cell address w/ text)

HTH, Greg

Cheryl said:
I have downloaded a text file into Excel. The nos. are reflected as text
and I am not able to perform sum function. eg. negative 4 is shown as 4-.
How can I quickly convert it into numbers without having to go to each of
them and key the - in front of the nos? I have tried reformat it to numbers
to no avail.
 
Cheryl

If Excel version 2002 or newer.......not sure of 2000, but don't think so.

Data>Text to Columns>Next>Next "Advanced". Check "Trailing minus for negative
numbers." Then "Finish".

Alternate.......

Sub Negsignleft()
Dim cell As Range
Dim rng As Range
''move minus sign from right to left on entire worksheet
On Error Resume Next
Set rng = ActiveSheet.Cells. _
SpecialCells(xlCellTypeConstants, xlTextValues)
On Error GoTo 0
For Each cell In rng
If IsNumeric(cell.Value) Then
cell.Value = CDbl(cell.Value)
End If
Next cell
End Sub

Gord Dibben Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top