ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   moving minus sign from right to left (https://www.excelbanter.com/excel-worksheet-functions/24046-moving-minus-sign-right-left.html)

GEORGIA

moving minus sign from right to left
 
I have worksheet that has "-" on the right side of the number
14.59-
45.99-
I have used
=IF(RIGHT(J2,2)="-",-SUBSTITUTE(J2,"-",""),J2)
which logical test should return "True".

However, it is returning "false" for all of the numbers. even with ones
without "-" on the right.
I have text column to "General", "number" and "Text".

help!
Thank you!

JE McGimpsey

Take a look he

Convert trailing minus signs
http://www.mcgimpsey.com/excel/postfixnegatives.html

In article ,
"GEORGIA" wrote:

I have worksheet that has "-" on the right side of the number
14.59-
45.99-
I have used
=IF(RIGHT(J2,2)="-",-SUBSTITUTE(J2,"-",""),J2)
which logical test should return "True".

However, it is returning "false" for all of the numbers. even with ones
without "-" on the right.
I have text column to "General", "number" and "Text".

help!
Thank you!


Duke Carey

You are testing to see if 2 characters are equal to a single character.
That's rather unlikely to ever be true.

Try using RIGHT(J2,1) ="-" instead


"GEORGIA" wrote:

I have worksheet that has "-" on the right side of the number
14.59-
45.99-
I have used
=IF(RIGHT(J2,2)="-",-SUBSTITUTE(J2,"-",""),J2)
which logical test should return "True".

However, it is returning "false" for all of the numbers. even with ones
without "-" on the right.
I have text column to "General", "number" and "Text".

help!
Thank you!


dave m

Hi Georgia,
copy this fomula and it will work
=IF(RIGHT(j2,1)="-",-SUBSTITUTE(j2,"-",""),j2)
Your idea was close but not quite.
Hope this helps
Rgds,
Dave
"GEORGIA" wrote:

I have worksheet that has "-" on the right side of the number
14.59-
45.99-
I have used
=IF(RIGHT(J2,2)="-",-SUBSTITUTE(J2,"-",""),J2)
which logical test should return "True".

However, it is returning "false" for all of the numbers. even with ones
without "-" on the right.
I have text column to "General", "number" and "Text".

help!
Thank you!



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

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