+ Reply to Thread
Results 1 to 6 of 6

Turning negative results to 0 in an ongoing sum

  1. #1
    Registered User
    Join Date
    10-25-2013
    Location
    Isle of Man
    MS-Off Ver
    Excel 2007
    Posts
    3

    Post Turning negative results to 0 in an ongoing sum

    Hello everyone,

    I have a tricky question that I can't find the answer to no matter how hard I google.

    I have a long list of numbers, and I need to summarize them in such a way that whenever it dips below 0, it gets treated as zero.

    For example, if the list is

    10
    -20
    10

    then the result should be 10, rather than 0

    As the list is quite long, if(if(A1+A2<0, "0",A1+A2)+A3... wouldn't work unfortunately.

    Thanks a lot
    Zandi

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Turning negative results to 0 in an ongoing sum

    Try

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


    But the result should be 20. Not 10. Correct?
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Contributor
    Join Date
    01-30-2013
    Location
    Wales
    MS-Off Ver
    Excel 2013
    Posts
    231

    Re: Turning negative results to 0 in an ongoing sum

    Try =Sumif(A1:A3,">0")

    Chris

  4. #4
    Registered User
    Join Date
    10-25-2013
    Location
    Isle of Man
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Turning negative results to 0 in an ongoing sum

    Hey guys,

    Thanks for the proposed solutions.

    Unfortunately it's not that simple, the result should be 10

    The way it shouldwork is that whenever a step in the calculation goes below 0, it is treated as 0.

    So in my example you have

    ((10 - 20) + 10)

    Because 10 - 20 is -10, that should be treated as zero, and the final result is then 10

    I found a roundabout solution like so:

    10 =A1
    -20 =IF(B1+A2<0,0,A2+B1)
    10 =IF(B2+A3<0,0,A3+B2)

    Would be happy to hear there's a more elegant solution, but if not, this will do

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,110

    Re: Turning negative results to 0 in an ongoing sum

    Here, try this in B2. Data must start from A2 (first row must be empty).

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


    and extend down
    Never use Merged Cells in Excel

  6. #6
    Registered User
    Join Date
    10-25-2013
    Location
    Isle of Man
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Turning negative results to 0 in an ongoing sum

    Brilliant! Thanks a lot

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Turning a negative into a positive.
    By menstonbantam in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-05-2012, 07:44 PM
  2. Turning positive numbers to negative
    By rajivvyas in forum Excel General
    Replies: 3
    Last Post: 03-28-2006, 12:24 PM
  3. turning a negative into a positive
    By childothe1980s in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-17-2006, 11:30 PM
  4. Turning a negative into a positive
    By [email protected] in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-16-2006, 12:45 AM
  5. Negative Results
    By Denise in forum Excel General
    Replies: 2
    Last Post: 10-07-2005, 05:05 PM

Tags for this Thread

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