Forum Discussion
Leo Kim
Sep 21, 2018Copper Contributor
Changing numbers into negative or positive depending on the number condition
I have data in Excel that says 12.3 R, 30.2 L and things like that in 2 columns. It basically means 12.3 degree to the right and 30.2 degree to the left. All I want to do is change that into 12.3 and...
- Sep 22, 2018
since you said you only have 2 columns,
a simple way is to use helper column and a simple formula
pls see attached file
hope this helps
thanks..
Leo Kim
Sep 22, 2018Copper Contributor
This worked beautifully...Thank you. One additional question is, what if the character was 12R and not 12 R? Is there any change in the formula?
Lorenzo Kim
Sep 22, 2018Bronze Contributor
change the -2 to -1
=IF(RIGHT(A1,1)="R",LEFT(A1,LEN(A1)-1)*1,LEFT(A1,LEN(A1)-2)*-1)
=IF(RIGHT(A1,1)="R",LEFT(A1,LEN(A1)-1)*1,LEFT(A1,LEN(A1)-2)*-1)
- Leo KimSep 22, 2018Copper ContributorThank you!
- Lorenzo KimSep 22, 2018Bronze Contributorglad to help..