Multiple Sum Line help please

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Hanger
    SBR MVP
    • 01-25-09
    • 2115

    #1
    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.
  • djiddish98
    SBR Sharp
    • 11-13-09
    • 345

    #2
    Try =IF(AND(C3>0,D3>0),etc) - is that your syntax?
    Comment
    • Hanger
      SBR MVP
      • 01-25-09
      • 2115

      #3
      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.
      Comment
      • Hanger
        SBR MVP
        • 01-25-09
        • 2115

        #4
        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)
        Comment
        • djiddish98
          SBR Sharp
          • 11-13-09
          • 345

          #5
          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.
          Comment
          • Hanger
            SBR MVP
            • 01-25-09
            • 2115

            #6
            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!
            Comment
            • Hanger
              SBR MVP
              • 01-25-09
              • 2115

              #7
              I had to adjust the additions and subtractions once I got everything in the right place.
              Comment
              • tomcowley
                SBR MVP
                • 10-01-07
                • 1129

                #8
                =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.
                Comment
                • djiddish98
                  SBR Sharp
                  • 11-13-09
                  • 345

                  #9
                  Originally posted by tomcowley
                  =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.
                  Comment
                  • djiddish98
                    SBR Sharp
                    • 11-13-09
                    • 345

                    #10
                    Originally posted by Hanger

                    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.
                    Comment
                    SBR Contests
                    Collapse
                    Top-Rated US Sportsbooks
                    Collapse
                    Working...