ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   'Text' instead of number (https://www.excelbanter.com/excel-discussion-misc-queries/2894-text-instead-number.html)

RJB

'Text' instead of number
 
I have spent two days manipulating data (about 300,000 cells' worth) I
imported as Fixed-Width (from MAS-90, if anyone cares).

The final step involves multiplying two numbers.

The POSITIVE numbers imported fine, the NEGATIVE numbers imported as

X.000-

and give me a #VALUE! error when I use any math function with them.

I have tried the Trimall macro.

I am guessing that somehow Excel thinks the '-' is a DASH and not a
negative... How do I change that????



Jason Morin

See:

http://www.mcgimpsey.com/excel/postfixnegatives.html

HTH
Jason
Atlanta, GA

-----Original Message-----
I have spent two days manipulating data (about 300,000

cells' worth) I
imported as Fixed-Width (from MAS-90, if anyone cares).

The final step involves multiplying two numbers.

The POSITIVE numbers imported fine, the NEGATIVE numbers

imported as

X.000-

and give me a #VALUE! error when I use any math function

with them.

I have tried the Trimall macro.

I am guessing that somehow Excel thinks the '-' is a

DASH and not a
negative... How do I change that????


.


Aladin Akyurek

Data|Text to Columns has an Advanced button (Excel 2003) for trailing
minuses you can check.

RJB wrote:
I have spent two days manipulating data (about 300,000 cells' worth) I
imported as Fixed-Width (from MAS-90, if anyone cares).

The final step involves multiplying two numbers.

The POSITIVE numbers imported fine, the NEGATIVE numbers imported as

X.000-

and give me a #VALUE! error when I use any math function with them.

I have tried the Trimall macro.

I am guessing that somehow Excel thinks the '-' is a DASH and not a
negative... How do I change that????



Peo Sjoblom

For Excel 2002 onwards you can use datatext to columns, clcik next twice, in
step 3 select advanced and trailing minus for negative numbers, click finish

in earlier versions you would need a macro or a help formula

Sub Fix_Minus()
Dim cell As Range
On Error Resume Next
For Each cell In Selection.Cells.SpecialCells(xlConstants, xlTextValues)
cell.Value = CDbl(cell.Value)
Next cell
End Sub

(press alt + f11, click insert module, paste in the above, press alt + q,
select the import, press alt + f8 and run the macro)

formula would be

=IF(RIGHT(A1,1)="-",-SUBSTITUTE(A1,"-",""),A1)

copy and paste special as values over the old range


Regards,

Peo Sjoblom

"RJB" wrote:

I have spent two days manipulating data (about 300,000 cells' worth) I
imported as Fixed-Width (from MAS-90, if anyone cares).

The final step involves multiplying two numbers.

The POSITIVE numbers imported fine, the NEGATIVE numbers imported as

X.000-

and give me a #VALUE! error when I use any math function with them.

I have tried the Trimall macro.

I am guessing that somehow Excel thinks the '-' is a DASH and not a
negative... How do I change that????




All times are GMT +1. The time now is 07:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com