+ Reply to Thread
Results 1 to 12 of 12

Need help with SUM formula (multiple cells) that shouldn't leave result trail

  1. #1
    Registered User
    Join Date
    06-14-2013
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    35

    Cool Need help with SUM formula (multiple cells) that shouldn't leave result trail

    Hello again,

    My first problem was solved by ACE.

    Here is second one:

    So this is what I am looking to achieve. In my file, that is attached, I want the Total column (G) to display the SUM values only when the three columns D+E+F is input (or any left blank). So right now G8:G46 is displaying the value fully in a long line going down. I don't want that. I want the formulas to stay in place from G8:G46 but only want the TOTAL value to display ONLY AFTER the columns D+E+F values are put in. So G10 should be invisible (keeping the sum formula in there). And only after I input the D10,E10,F10 (or any two or any one) value should the G10 display the sum of G9+D10+E10+F10.

    Is there anyway that I can do that? Or do I have to live with the long list of "40" that you currently see in TOTAL column (G)?


    Thanks!!!
    Attached Files Attached Files
    Last edited by aalim95; 06-18-2013 at 04:52 PM.

  2. #2
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Need help with SUM formula (multiple cells) that shouldn't leave result trail

    =CHOOSE(AND(D8="",E8="",F8="")*1 +1,SUM(D8:F8,G7),"")

    copy that down the column :D - see attachment.


    you could also do this with conditional formatting if you like...
    Attached Files Attached Files
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  3. #3
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Need help with SUM formula (multiple cells) that shouldn't leave result trail

    In G9

    =IF(COUNT(D9:F9)=3,G8+SUM(D9:F9),"")

    Copy down
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  4. #4
    Registered User
    Join Date
    06-14-2013
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Need help with SUM formula (multiple cells) that shouldn't leave result trail

    Hey guys,

    Every time I try to apply the formula to other places with cells that need to be deducted it's not going away.

    Can you please help with this new file? Please check the second sheet. I have spent hours on this and still can't get a solution to it.

    Problem that needs to be fixed: Columns L, U, and V should not show the ENTIRE TRAIL. It should only show the additional result till the last entry made. However the formulas still need to be there so that future inputs are automatically added. This problem is just like my first post.

    Thanks,
    Attached Files Attached Files

  5. #5
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Need help with SUM formula (multiple cells) that shouldn't leave result trail

    hmm. you need to avoid blanks in the rows for this to work.

    look at the cells i highlighted for you in the L column, those numbers are wrong because there is no number above them.

    Could work out a couple of other fancy solutions to fix it (conditional formatting, or more confusing functions to find the previous value....) but really, if you just avoid "gaps" in the data you will be fine.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    06-14-2013
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Need help with SUM formula (multiple cells) that shouldn't leave result trail

    The way I developed the format I guess gaps are bound to be there

    I can't imagine just to avoid the trail I'd have to have such a hard time.

    I did figure that if I entered zero other than leaving gaps your formula works fine.

    Thanks a lot for your efforts! But do you think there is any other way that will solve the gap situation as well?

    Thanks!

  7. #7
    Registered User
    Join Date
    06-14-2013
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Need help with SUM formula (multiple cells) that shouldn't leave result trail

    Seriously, how did you learn all these complex formulas? I have decided that I am going to start learning excel in its advanced form but the formulas are so many and Microsoft Help has so many solutions I just don't understand where to start. Any suggestion as to how I can start learning excel in an advanced manner so that in a year (assuming I practice everyday) I can start writing formulas like you do?

    Thanks

  8. #8
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Need help with SUM formula (multiple cells) that shouldn't leave result trail

    Just realized something simple :D - See the attachment.

    If you use this, there is no "gap" problem. This would need to be put in the 7th row, and copy/pasted down.

    =CHOOSE(AND(B7="",C7="",D7="",I7="",J7="")*1+1,SUM(B$7:B7,D$7:D7)-SUM(C$7:C7,I$7:I7,J$7:J7),"")
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    06-14-2013
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Need help with SUM formula (multiple cells) that shouldn't leave result trail

    Hey man,

    Thanks so much for your help. You got it right...but only to some extent

    The problem that occurred now is if you notice the file the balance in 14E (cell L9) shows 5,000 in stock and at that point cell U9 also needs to show 10,000 in stock. So the total stock (which is L9+U9) should be 15,000 and not 5,000 that it is showing currently.

    I never realized this sum result trail was going to be such a big pain in the butt

    I do appreciate your help and am learning a lot.

    Thanks,
    A
    Attached Files Attached Files

  10. #10
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Cool Re: Need help with SUM formula (multiple cells) that shouldn't leave result trail

    =CHOOSE(AND(B9="",C9="",D9="",I9="",J9="")*1+1,SUM(N$7:N9,P$7:P9)-SUM(O$7:O9,S$7:S9,T$7:T9),"")

    That section I highlighted is the key idea. This formula is "turning off" the summation when there are blanks in those cells. If you want both U and L to be blank or not blank at the same time (which is what your comment indicates), then used the same AND() function in both columns.


    See attached.


    BTW, this is what the function is doing.

    CHOOSE( 1 or 2, show summation if 1, nothing if 2)

    IF you have blanks in the b,c,d,i,j columns for a row, then the AND function becomes AND(TRUE,TRUE,TRUE,TRUE,TRUE) which evaluates to TRUE. Basically, and AND function only returns the value, TRUE or FALSE. True is returned ONLY when all of the arguments are TRUE. Even if you have 1000 arguments, 999 of which are true, if 1 of them is false the entire AND() function is false.


    Also. When you multiply by TRUE or FALSE excel treats these boolean values (look up boolean logic) as 1 and 0 respectively. SO, TRUE*1 = 1 and FALSE*1 = 0

    That's how I know the choose function index (the first part of the function argument list) will always evaluate to 1 or 2. Because, TRUE*1+1 = 2 and FALSE*1+1 = 1

    :D :D :D

    ...the more you know...
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    06-14-2013
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Need help with SUM formula (multiple cells) that shouldn't leave result trail

    I wish I could give you some reputation right here.

    Your post was extremely informative as it not only provided the formula but also the explanation. I am a believer that if you learn the thing than just taking the solution you can do a great deal good to others including yourself. So a MILLION THANKS!

    I am going to go over it since I am a little busy today and if there are further questions I'll get back. However for now I will put the thread as [SOLVED].

    THANKS MAN!

  12. #12
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Need help with SUM formula (multiple cells) that shouldn't leave result trail

    great to hear , thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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