How to convert text to number, especially negative value:-
9,669.34 to 9,669.34 2,553.57- to (2,553.57)
When I used this formula, =SUBSTITUTE(A1,CHAR(160),"")+0, it works well but only for positive value. I rcv'd #VALUE! for all negative values.
How to convert text to number, especially negative value:-
9,669.34 to 9,669.34 2,553.57- to (2,553.57)
When I used this formula, =SUBSTITUTE(A1,CHAR(160),"")+0, it works well but only for positive value. I rcv'd #VALUE! for all negative values.
For (2,553.57), you can use VALUE
, such as VALUE("(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
=VALUE(IF(RIGHT(A2,1)="-","-"&SUBSTITUTE(A2,"-",""),A2))
From the Microsoft site:
More information can be found at Microsoft's website: Value Function