Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default HELP - weird Negative Numbers

Newbie questions :
I am currently working with some output report from my company
database in *.txt format. After converting to *.xls, i got the
negative records shows negative sign AFTER the number (example : 254
-) instead of before the number like it normally does.

Let say the number is in cell B1. So I use :
=IF(RIGHT(B1,1)="-",LEFT(B1,(LENB1)-1)))*-1,B1) to make it right.

Is there any simpler way rather than having some conditions ?

TIA
michael
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default HELP - weird Negative Numbers

Hi Michael
one way: If you have Excel 2002+: Select the cells. goto 'Data - Text
to columns'. Click OK, OK, then Advanced. Check the treat trailing
minus as negative checkbox, then Finish. This should do

Also have a look at:
http://www.mcgimpsey.com/excel/postfixnegatives.html

HTH
Frank

Michael Rhein wrote:
Newbie questions :
I am currently working with some output report from my company
database in *.txt format. After converting to *.xls, i got the
negative records shows negative sign AFTER the number (example : 254
-) instead of before the number like it normally does.

Let say the number is in cell B1. So I use :
=IF(RIGHT(B1,1)="-",LEFT(B1,(LENB1)-1)))*-1,B1) to make it right.

Is there any simpler way rather than having some conditions ?

TIA
michael



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default HELP - weird Negative Numbers

=SUBSTITUTE(A1,"-","")*-1
does shorter = simpler?
HTH

"Michael Rhein" wrote in message
om...
Newbie questions :
I am currently working with some output report from my company
database in *.txt format. After converting to *.xls, i got the
negative records shows negative sign AFTER the number (example : 254
-) instead of before the number like it normally does.

Let say the number is in cell B1. So I use :
=IF(RIGHT(B1,1)="-",LEFT(B1,(LENB1)-1)))*-1,B1) to make it right.

Is there any simpler way rather than having some conditions ?

TIA
michael



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default HELP - weird Negative Numbers

Hi JMay,

Probably yes, but you should check the form before negating it. This then
gives

=IF(ISERROR(FIND("-",A2)),A2,SUBSTITUTE(A2,"-","")*-1)

which ceases to be shorter <vbg

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"JMay" wrote in message
news:V14Ub.21640$fZ6.13414@lakeread06...
=SUBSTITUTE(A1,"-","")*-1
does shorter = simpler?
HTH

"Michael Rhein" wrote in message
om...
Newbie questions :
I am currently working with some output report from my company
database in *.txt format. After converting to *.xls, i got the
negative records shows negative sign AFTER the number (example : 254
-) instead of before the number like it normally does.

Let say the number is in cell B1. So I use :
=IF(RIGHT(B1,1)="-",LEFT(B1,(LENB1)-1)))*-1,B1) to make it right.

Is there any simpler way rather than having some conditions ?

TIA
michael





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default HELP - weird Negative Numbers

Good point Bob,
Heads Up - Michael!!

JMay

"Bob Phillips" wrote in message
...
Hi JMay,

Probably yes, but you should check the form before negating it. This then
gives

=IF(ISERROR(FIND("-",A2)),A2,SUBSTITUTE(A2,"-","")*-1)

which ceases to be shorter <vbg

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"JMay" wrote in message
news:V14Ub.21640$fZ6.13414@lakeread06...
=SUBSTITUTE(A1,"-","")*-1
does shorter = simpler?
HTH

"Michael Rhein" wrote in message
om...
Newbie questions :
I am currently working with some output report from my company
database in *.txt format. After converting to *.xls, i got the
negative records shows negative sign AFTER the number (example : 254
-) instead of before the number like it normally does.

Let say the number is in cell B1. So I use :
=IF(RIGHT(B1,1)="-",LEFT(B1,(LENB1)-1)))*-1,B1) to make it right.

Is there any simpler way rather than having some conditions ?

TIA
michael









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default HELP - weird Negative Numbers

Guys, tons of thanks !!....
the Subtitute formula works like Magic !..
Thanks again
MR



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
weird! Excel refuses to compute numbers... LunaMoon Excel Discussion (Misc queries) 4 November 25th 08 01:52 AM
Excel 2002 : Convert Positive Numbers to Negative Numbers ? Mr. Low Excel Discussion (Misc queries) 2 November 6th 06 03:30 PM
Set negative numbers to zero. Do not calculate with negative valu Excel Headache Excel Discussion (Misc queries) 4 September 14th 06 08:56 PM
change 2000 cells (negative numbers) into positive numbers lisbern Excel Worksheet Functions 2 August 16th 06 05:54 PM
Excel Formula - Add column of numbers but ignore negative numbers view for Distribution List members Excel Worksheet Functions 1 April 7th 06 03:13 AM


All times are GMT +1. The time now is 10:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"