+ Reply to Thread
Results 1 to 10 of 10

Adding Positive and Negatives

  1. #1
    Registered User
    Join Date
    05-30-2012
    Location
    Tennessee
    MS-Off Ver
    Excel 2007
    Posts
    29

    Adding Positive and Negatives

    This should be simple, but I'm struggling.

    I have two columns of numbers that I am trying to find the difference between.

    If A1 is negative and B1 is positive the formula A1-B1 will add the two columns together. The numbers switch signs as you go down the column. I want one formula that will return the difference regardless of the sign. I don't want the absolute value of the difference....but rather the difference.

    Any ideas?

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Adding Positive and Negatives

    Subtraction does give the difference between two numbers, irrespective of sign.

    How about some examples of what you expect?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor wakeupcall's Avatar
    Join Date
    02-29-2012
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    155

    Re: Adding Positive and Negatives

    Hi,

    How about

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    05-30-2012
    Location
    Tennessee
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Adding Positive and Negatives

    See the attached.
    Attached Files Attached Files

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Adding Positive and Negatives

    From your examples, it looks like you want the sum, not the difference. In C1 and copy down, =A1+B1

  6. #6
    Registered User
    Join Date
    05-30-2012
    Location
    Tennessee
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Adding Positive and Negatives

    Thanks, but that returns the same thing I'm getting with my mile long formula. This is accounting, so I need my debits to be debits and my credits to be credits. I attached a sample of my data. If anyone can figure this out, I'd be most grateful.

  7. #7
    Forum Contributor wakeupcall's Avatar
    Join Date
    02-29-2012
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    155

    Re: Adding Positive and Negatives

    Perhaps,

    this is what you mean then

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    05-30-2012
    Location
    Tennessee
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Adding Positive and Negatives

    No, it's more complex than that. My formula works, right up until column A2 has a 0. B2 is a Debit, so it should be using the first argument in the formula, not the last. The problem is, the first argument says if A2 is less than 0 (a negative number), then sum. How do I get it to say less than or equal to zero.

    =IF(AND(A3<0,B3>0),SUM(A3:B3),IF(AND(A3>0,B3<0),SUM(A3:B3),A3-B3))

  9. #9
    Forum Contributor wakeupcall's Avatar
    Join Date
    02-29-2012
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    155

    Re: Adding Positive and Negatives

    add equal sign after ">"

  10. #10
    Registered User
    Join Date
    05-30-2012
    Location
    Tennessee
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Adding Positive and Negatives

    Your formula worked Wakeup! Thank you so very much. Though I can't say it out loud in long form....which I like to do because it seems to make sense to me that way. Oh well, at least it works...and that's what's important at this point.

    Thank you again!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1