How can I convert text representations of numbers into Excel numbers, especially negative values? For example, the string “9,669.34” (without quotes) should become the number 9,669.34 and the string “2,553.57-” (again, without quotes) should become the number (2,553.57).
When I used the formula =SUBSTITUTE(A1,CHAR(160),"")+0, it worked well, but only for positive values. I received the result #VALUE! for all negative values.
For (2,553.57), you can use
VALUE, such asVALUE("(2,553.57)").Excel doesn’t seem to recognize 2,553.57- as a valid number when it is a string, so assuming you have a value of “2,553.57-” in A1, you would have to do a little more work:
=VALUE(IF(RIGHT(A2,1)=”-“,”-“&SUBSTITUTE(A2,”-“,””)))EDIT
From the Microsoft site:
by Microsoft Excel. If text is not in one of these formats, VALUE returns the
#VALUE! error value.
automatically converts text to numbers as necessary. This function is provided
for compatibility with other spreadsheet programs.
More information can be found at Microsoft’s website: Value Function