+ Reply to Thread
Results 1 to 12 of 12

don't sum zeros

  1. #1
    Registered User
    Join Date
    09-26-2012
    Location
    socal
    MS-Off Ver
    Excel 2010
    Posts
    48

    don't sum zeros

    I have this formula that sums the low 4 number out of 5 but if there is a 0 in the mix it treats it as one of the low number and I want to ignore it so if there is only 3 numbers then add them up or 2 or 1. Here is the formula.

    =sum(small(c6:g6,{1,2,3,4}))

  2. #2
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: don't sum zeros

    Is it important to have the 0 there? If you delete the 0 so that the cell is empty, it will sum the correct set of low numbers.
    Regards,
    Rudi

  3. #3
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: don't sum zeros

    Try this Array Formula. Since this is an array formula so you need to confirm it with Ctrl + Shift + Enter instead of just Enter. (i.e. hold down the Ctrl + Shift and then press Enter)

    Please Login or Register  to view this content.
    Hope this helps.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: don't sum zeros

    Try this...

    =IFERROR(SUM(SMALL(C6:G6,COUNTIF(C6:G6,0)+{1,2,3,4})),SUM(C6:G6))


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,421

    Re: don't sum zeros

    What about SUMIF?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  6. #6
    Registered User
    Join Date
    09-26-2012
    Location
    socal
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: don't sum zeros

    sktneer: Yours worked fine until I had 2 out of the 5 numbers at 0. there could be as many as 4 out of the five that are 0.

  7. #7
    Registered User
    Join Date
    09-26-2012
    Location
    socal
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: don't sum zeros

    sixthsense: your formula returned an error #name. Sorry I forgot to mention I's using 2003.

  8. #8
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: don't sum zeros

    Quote Originally Posted by JimLau View Post
    sixthsense: your formula returned an error #name. Sorry I forgot to mention I's using 2003.
    Try this...

    =IF(ISERR(SUM(SMALL(C6:G6,COUNTIF(C6:G6,0)+{1,2,3,4}))),SUM(C6:G6),SUM(SMALL(C6:G6,COUNTIF(C6:G6,0)+{1,2,3,4})))

  9. #9
    Registered User
    Join Date
    09-26-2012
    Location
    socal
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: don't sum zeros

    Sixthsense: Added to your rep. Thanks again for your help worked perfectly.

  10. #10
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,274

    Re: don't sum zeros

    Maybe:
    =if(countif(c6:g6,0),sum(c6:g6),sum(small(c6:g6,{1,2,3,4})))
    since if there are any 0 values, the sum of all is the same as the sum of the lowest 4 of 5.
    Remember what the dormouse said
    Feed your head

  11. #11
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: don't sum zeros

    Quote Originally Posted by romperstomper View Post
    =if(countif(c6:g6,0),sum(c6:g6)
    Lol exactly pointed out and thanks for the correction too...

  12. #12
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: don't sum zeros

    Why not just:

    =SUM(C6:G6)-MAX(C6:G6)*(MIN(C6:G6)<>0)

    Regards
    Click * below if this answer helped

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

+ 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] Average for non-consecutive cells excluding zeros (even when they all contain zeros)
    By pao13 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-05-2012, 04:32 PM
  2. Replies: 2
    Last Post: 06-12-2012, 02:24 PM
  3. Replies: 5
    Last Post: 04-09-2012, 02:28 PM
  4. Replies: 2
    Last Post: 02-22-2008, 11:18 AM
  5. Replies: 1
    Last Post: 05-04-2005, 02:06 PM

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