Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 226
Default subtraction of negative numbers

I'm trying to create an equation that, on occation, will result in a
subtraction of a negative, which then results in a larger negative number
than it should be.

So for example:

=sum(A1 - B1)
A1 = -50
B1 = 40

so the results of this equation is -90, but in reality it should be -10.

seems simple but it's confusing the hell out of me.

thanks in advance for the help.
roger
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 29
Default subtraction of negative numbers

Hello Roger

The formula should be:

=SUM(A1:B1)

What you were effectively doing was

=A1-B1

Richard


"Roger" wrote in message
...
I'm trying to create an equation that, on occation, will result in a
subtraction of a negative, which then results in a larger negative number
than it should be.

So for example:

=sum(A1 - B1)
A1 = -50
B1 = 40

so the results of this equation is -90, but in reality it should be -10.

seems simple but it's confusing the hell out of me.

thanks in advance for the help.
roger


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,358
Default subtraction of negative numbers

Anytime you subtract a negative, you make it a positive. That is not your
error here though.

You have A1(-50) MINUS B1(40), ... -50-40=-90
The result you are requsting is A1+B1, ... -50+40=-10

Hope this helps.

--
John C


"Roger" wrote:

I'm trying to create an equation that, on occation, will result in a
subtraction of a negative, which then results in a larger negative number
than it should be.

So for example:

=sum(A1 - B1)
A1 = -50
B1 = 40

so the results of this equation is -90, but in reality it should be -10.

seems simple but it's confusing the hell out of me.

thanks in advance for the help.
roger

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default subtraction of negative numbers

Well, if you take 40 away from -50 the answer is -90. Imagine you were
overdrawn at your bank by $50 and you wrote a check for $40 - you
would then be overdrawn by $90. (I'm assuming you are in the US)

If you just want the numerical difference between the two numbers, and
for this to be expressed as a positive number, you can do this:

=ABS(ABS(A1)-ABS(B1))

Hope this helps.

Pete

On Oct 8, 7:04*pm, Roger wrote:
I'm trying to create an equation that, on occation, will result in a
subtraction of a negative, which then results in a larger negative number
than it should be.

So for example:

=sum(A1 - B1)
A1 = -50
B1 = 40

so the results of this equation is -90, but in reality it should be -10.

seems simple but it's confusing the hell out of me.

thanks in advance for the help.
roger


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default subtraction of negative numbers

So, if *either* number is negative then the result should be negative?

Try this array formula** :

=IF(COUNTIF(A1:B1,"<0"),-SUM(ABS(A1:B1)),A1+B1)

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

Or, normally enter this slightly longer version:

=IF(COUNTIF(A1:B1,"<0"),-SUM(ABS(A1),ABS(B1)),A1+B1)

--
Biff
Microsoft Excel MVP


"Roger" wrote in message
...
I'm trying to create an equation that, on occation, will result in a
subtraction of a negative, which then results in a larger negative number
than it should be.

So for example:

=sum(A1 - B1)
A1 = -50
B1 = 40

so the results of this equation is -90, but in reality it should be -10.

seems simple but it's confusing the hell out of me.

thanks in advance for the help.
roger





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 226
Default subtraction of negative numbers

I realize I didn't complete my problem, that is that column A will have both
negative and positive numbers, so A1+B1 will be incorrect in those cases.

I want -50 - +40 = -10

Hope that makes sense.

"John C" wrote:

Anytime you subtract a negative, you make it a positive. That is not your
error here though.

You have A1(-50) MINUS B1(40), ... -50-40=-90
The result you are requsting is A1+B1, ... -50+40=-10

Hope this helps.

--
John C


"Roger" wrote:

I'm trying to create an equation that, on occation, will result in a
subtraction of a negative, which then results in a larger negative number
than it should be.

So for example:

=sum(A1 - B1)
A1 = -50
B1 = 40

so the results of this equation is -90, but in reality it should be -10.

seems simple but it's confusing the hell out of me.

thanks in advance for the help.
roger

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,358
Default subtraction of negative numbers

-50 - +40 is still = -90
As the others posted, you really want
-50+40 = -10
Now, if the 40 is being displayed as a positive number, but it has a
negative reference (i.e.: even though it shows as 40 in cell B1, and not -40
in B1), then you want A1+B1 which is the same as -50 + 40 = -10 which is
the same as
-50 - -40 = -10
--
John C


"Roger" wrote:

I realize I didn't complete my problem, that is that column A will have both
negative and positive numbers, so A1+B1 will be incorrect in those cases.

I want -50 - +40 = -10

Hope that makes sense.

"John C" wrote:

Anytime you subtract a negative, you make it a positive. That is not your
error here though.

You have A1(-50) MINUS B1(40), ... -50-40=-90
The result you are requsting is A1+B1, ... -50+40=-10

Hope this helps.

--
John C


"Roger" wrote:

I'm trying to create an equation that, on occation, will result in a
subtraction of a negative, which then results in a larger negative number
than it should be.

So for example:

=sum(A1 - B1)
A1 = -50
B1 = 40

so the results of this equation is -90, but in reality it should be -10.

seems simple but it's confusing the hell out of me.

thanks in advance for the help.
roger

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default subtraction of negative numbers

I have a similar problem but I don't want the result to always be negative.
If A1 is negative and B1 is positive then I want the negative in A1 to be
reduced by the positive in B1 and reflect a negative amount (ie. -900 minus
+200 = -700) but sometimes the amount in A1 is positive and B1 is positive
and so then I just want B1 subtracted from A1 to reflect a positive (i.e.
+900 minus +200 = +700).

"T. Valko" wrote:

So, if *either* number is negative then the result should be negative?

Try this array formula** :

=IF(COUNTIF(A1:B1,"<0"),-SUM(ABS(A1:B1)),A1+B1)

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

Or, normally enter this slightly longer version:

=IF(COUNTIF(A1:B1,"<0"),-SUM(ABS(A1),ABS(B1)),A1+B1)

--
Biff
Microsoft Excel MVP


"Roger" wrote in message
...
I'm trying to create an equation that, on occation, will result in a
subtraction of a negative, which then results in a larger negative number
than it should be.

So for example:

=sum(A1 - B1)
A1 = -50
B1 = 40

so the results of this equation is -90, but in reality it should be -10.

seems simple but it's confusing the hell out of me.

thanks in advance for the help.
roger




  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,240
Default subtraction of negative numbers

=A1-B1*SIGN(A1)

bwbmom wrote:
I have a similar problem but I don't want the result to always be negative.
If A1 is negative and B1 is positive then I want the negative in A1 to be
reduced by the positive in B1 and reflect a negative amount (ie. -900 minus
+200 = -700) but sometimes the amount in A1 is positive and B1 is positive
and so then I just want B1 subtracted from A1 to reflect a positive (i.e.
+900 minus +200 = +700).

"T. Valko" wrote:

So, if *either* number is negative then the result should be negative?

Try this array formula** :

=IF(COUNTIF(A1:B1,"<0"),-SUM(ABS(A1:B1)),A1+B1)

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

Or, normally enter this slightly longer version:

=IF(COUNTIF(A1:B1,"<0"),-SUM(ABS(A1),ABS(B1)),A1+B1)

--
Biff
Microsoft Excel MVP


"Roger" wrote in message
...
I'm trying to create an equation that, on occation, will result in a
subtraction of a negative, which then results in a larger negative number
than it should be.

So for example:

=sum(A1 - B1)
A1 = -50
B1 = 40

so the results of this equation is -90, but in reality it should be -10.

seems simple but it's confusing the hell out of me.

thanks in advance for the help.
roger



  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default subtraction of negative numbers

Thanks Glenn - I used the example you gave in the other thread and it worked
perfectly.

"Glenn" wrote:

=A1-B1*SIGN(A1)

bwbmom wrote:
I have a similar problem but I don't want the result to always be negative.
If A1 is negative and B1 is positive then I want the negative in A1 to be
reduced by the positive in B1 and reflect a negative amount (ie. -900 minus
+200 = -700) but sometimes the amount in A1 is positive and B1 is positive
and so then I just want B1 subtracted from A1 to reflect a positive (i.e.
+900 minus +200 = +700).

"T. Valko" wrote:

So, if *either* number is negative then the result should be negative?

Try this array formula** :

=IF(COUNTIF(A1:B1,"<0"),-SUM(ABS(A1:B1)),A1+B1)

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

Or, normally enter this slightly longer version:

=IF(COUNTIF(A1:B1,"<0"),-SUM(ABS(A1),ABS(B1)),A1+B1)

--
Biff
Microsoft Excel MVP


"Roger" wrote in message
...
I'm trying to create an equation that, on occation, will result in a
subtraction of a negative, which then results in a larger negative number
than it should be.

So for example:

=sum(A1 - B1)
A1 = -50
B1 = 40

so the results of this equation is -90, but in reality it should be -10.

seems simple but it's confusing the hell out of me.

thanks in advance for the help.
roger


.

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
entering dates results in subtraction of numbers Deepak G Excel Worksheet Functions 8 June 5th 08 05:09 AM
Date subtraction -How to not show negative when 2nd date not entered Edward[_2_] New Users to Excel 2 September 27th 07 03:03 PM
I want to get negative hours if subtraction of hours is negative hema Excel Worksheet Functions 5 April 30th 07 10:02 AM
Set negative numbers to zero. Do not calculate with negative valu Excel Headache Excel Discussion (Misc queries) 4 September 14th 06 08:56 PM
subtraction in a list of numbers that resets with a label. gtslabs Excel Worksheet Functions 5 October 27th 05 02:20 PM


All times are GMT +1. The time now is 05:22 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"