Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Pat Pat is offline
external usenet poster
 
Posts: 210
Default Need help with a formula

I am having trouble with a subtraction formula, Hoping someone can help.
A2 is -200
B2 is 100
C2 needs the formula
What I have is =A2-B2*sign(A2) which works until A2 is 0, then it doesn't
subtract the cells, C2 becomes 0
Can anyone help with this formula.
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Need help with a formula

On Tue, 29 May 2007 03:47:00 -0700, Pat wrote:

I am having trouble with a subtraction formula, Hoping someone can help.
A2 is -200
B2 is 100
C2 needs the formula
What I have is =A2-B2*sign(A2) which works until A2 is 0, then it doesn't
subtract the cells, C2 becomes 0
Can anyone help with this formula.
Thanks


What are you trying to accomplish with this formula?

Perhaps if you give examples of the various contents of A2 and B2 and tell us
what you want to see as a result in C2?

-200 100 ?
-150 100 ?
-100 100 ?
-50 100 ?
0 100 ?
50 100 ?
100 100 ?
150 100 ?
200 100 ?


--ron
  #3   Report Post  
Junior Member
 
Location: Winters CA
Posts: 22
Default

=A2-IF(A2<0,-B2,B2) or
=IF(A2<0,A2+B2,A2-B2)

Quote:
Originally Posted by Pat View Post
I am having trouble with a subtraction formula, Hoping someone can help.
A2 is -200
B2 is 100
C2 needs the formula
What I have is =A2-B2*sign(A2) which works until A2 is 0, then it doesn't
subtract the cells, C2 becomes 0
Can anyone help with this formula.
Thanks
  #4   Report Post  
Posted to microsoft.public.excel.misc
bj bj is offline
external usenet poster
 
Posts: 1,397
Default Need help with a formula

maybe
=if(A1=0,-B1,(Abs(A1)-B1)*sign(A1))
or using your equation
=if(A1=0,-B1,A1-B1*sign(A1))

"Pat" wrote:

I am having trouble with a subtraction formula, Hoping someone can help.
A2 is -200
B2 is 100
C2 needs the formula
What I have is =A2-B2*sign(A2) which works until A2 is 0, then it doesn't
subtract the cells, C2 becomes 0
Can anyone help with this formula.
Thanks

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



All times are GMT +1. The time now is 02:33 AM.

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

About Us

"It's about Microsoft Excel"