minus quantities

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

I have to import data from a report writer that gives all
minus values with the minus sign after the number. for
example 1234- should be -1234, can anyone help me with
code to move the minus sign to the right position.
Thanks to all in advance.
 
I have to import data from a report writer that gives all
minus values with the minus sign after the number. for
example 1234- should be -1234, can anyone help me with
code to move the minus sign to the right position.
Thanks to all in advance.

If you have Excel 2002 (I don't know about earlier versions) and if you import
the data using the Text import wizard, there is an option for trailing minus
signs.

Otherwise, you could use the formula:

=IF(RIGHT(A1,1)="-",-LEFT(A1,LEN(A1)-1),A1)

This will give an error if there is anything but a number, or a number with a
trailing minus sign. If that is a problem, post back.


--ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top