1. #1
    Hanger
    NCAA '10 59.45% | 129-88-5
    Hanger's Avatar Become A Pro!
    Join Date: 01-25-09
    Posts: 2,115
    Betpoints: 215

    Multiple Sum Line help please

    =if(c3>0 and d3>0,(sum c3+d3, if(c3>0 and d3<0,(sum c3-d3, if(c3<0 and d3<0,(sum c3+d3, if(c3<0 and d3>0,(sum c3-d3))))))))


    It makes sense in my head, and I have tried multiple configurations here, it just wont go, any please? Thank you.

  2. #2
    djiddish98
    djiddish98's Avatar Become A Pro!
    Join Date: 11-13-09
    Posts: 345
    Betpoints: 237

    Try =IF(AND(C3>0,D3>0),etc) - is that your syntax?

  3. #3
    Hanger
    NCAA '10 59.45% | 129-88-5
    Hanger's Avatar Become A Pro!
    Join Date: 01-25-09
    Posts: 2,115
    Betpoints: 215

    Thanks djiddish98,

    I can admit I am an excel newbie here, but i am trying. With your recommendation =IF(AND(C3>0,D3>0),(sum C3+D3, IF(AND(C3>0,D3<0),(sum C3-D3, IF(AND(C3<0,D3<0),(sum C3+D3, IF(AND(C3<0,D3>0),(sum C3-D3))))))))

    The result ends up as false. I am trying to get it to display a number on different variables.

    E3= the Sum of C3-D3 if C3>0 AND D3>0
    E3=the sum of C3+D3 if C3>0 AND D3<0
    E3=the Sum of C3-D3 if C3<0 AND D3<0
    E3=the Sum of C3+D3 if C3<0 AND D3>0

    That is the equation I am trying to get across but if wont work.

    Does that make any sense.

  4. #4
    Hanger
    NCAA '10 59.45% | 129-88-5
    Hanger's Avatar Become A Pro!
    Join Date: 01-25-09
    Posts: 2,115
    Betpoints: 215

    Ok so I messed with it more and I have this. =IF(C3>0,SUM(C3-D3),IF(C3<0,SUM(C3+D3)))

    Which is working great, however, if the Value inputted in Column "D" is negative I need to redo the math. How would I add if D3 <0 and C3<0 Sum(D3-C3), if C3>0 Sum(D3+C3)

  5. #5
    djiddish98
    djiddish98's Avatar Become A Pro!
    Join Date: 11-13-09
    Posts: 345
    Betpoints: 237

    Let me see if I can simplify this

    =IF(C3>0,IF(D3<0,c3+d3,c3-d3),IF(D3<0,c3-d3,c3+d3))

    Try giving that a shot - we first evaluate if c3>0, then check for D3. If C3 is not greater than 0, we still do the D3 check, but it seems like we flip the outcomes if it's true or not.
    Points Awarded:

    Hanger gave djiddish98 5 SBR Point(s) for this post.


  6. #6
    Hanger
    NCAA '10 59.45% | 129-88-5
    Hanger's Avatar Become A Pro!
    Join Date: 01-25-09
    Posts: 2,115
    Betpoints: 215

    Awesome, I think you are getting me there....I had to change the order of the sums around to get it to act just like I needed, but I think thats doing the trick at the moment! That equation is much easier than what I was trying to do. Completely understand the way you explained it.

    IF C3>0, It checks D3<0, if it is it does c3+d3, if not it does c3-d3
    if C3<0 it checks D3<0 if it is it does c3-d3, if not it does c3+d3

    Here was the final formula that worked just as I wanted with the slight changes
    =IF(C3>0,IF(D3<0,C3+D3,D3-C3),IF(D3<0,D3+C3,C3+D3))

    Thank you so much DJiddish!! Points coming at ya!

  7. #7
    Hanger
    NCAA '10 59.45% | 129-88-5
    Hanger's Avatar Become A Pro!
    Join Date: 01-25-09
    Posts: 2,115
    Betpoints: 215

    I had to adjust the additions and subtractions once I got everything in the right place.

  8. #8
    tomcowley
    tomcowley's Avatar Become A Pro!
    Join Date: 10-01-07
    Posts: 1,129
    Betpoints: 6786

    =if(c3*d3>0,c3+d3,c3-d3)

    If you need to deal with one of them actually being 0, that can be done too.

  9. #9
    djiddish98
    djiddish98's Avatar Become A Pro!
    Join Date: 11-13-09
    Posts: 345
    Betpoints: 237

    Quote Originally Posted by tomcowley View Post
    =if(c3*d3>0,c3+d3,c3-d3)

    If you need to deal with one of them actually being 0, that can be done too.
    This - very nice solution.

  10. #10
    djiddish98
    djiddish98's Avatar Become A Pro!
    Join Date: 11-13-09
    Posts: 345
    Betpoints: 237

    Quote Originally Posted by Hanger View Post

    Here was the final formula that worked just as I wanted with the slight changes
    =IF(C3>0,IF(D3<0,C3+D3,D3-C3),IF(D3<0,D3+C3,C3+D3))
    If you want to simplify it more, you don't need the second if statement. The only time you're subtracting is if C3>0 AND D3> 0.

    I'm thinking =IF(AND(C3>0,d3>0),D3-C3,c3+d3)

    Unless there should be another subtraction in the second statement.

Top