+ Reply to Thread
Results 1 to 4 of 4

Min value to exclude zeros

  1. #1
    Registered User
    Join Date
    01-15-2013
    Location
    Indianapolis, IN
    MS-Off Ver
    Excel 2010
    Posts
    23

    Min value to exclude zeros

    Hello,

    I have a spreadsheet that I am wanting to have the minimum values of certain data. Sometimes the data includes all zeros, in which case I would like to have a "-" if the minimum does not exist, instead of a bunch of zeros across my page. I would also like the formula to work when there are no zeros. Here is what I have so far...

    This works fine when I am trying to do the max, if the data contains all zeros then it puts a "-", why will this same rule not apply to the MIN if I simply switch the "MAX" out with the word "MIN"?

    =IF(MAX(I15:I16),MAX(I15:I16),"-") ==> works for max, does not work correctly when I try to switch to min on the row beneath that.

    =MIN(IF((H15:H16)<>0,(H15:H16),"-")) ==> This works in excluding the zeros but it will not put a "-" if the row contains all zeros.

    I hope that I am explaining this thouroughly. ALl help is appreciated!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Min value to exclude zeros

    The two formulae are differently structured.

    Doesn't the equivalent
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    work? It seems OK to me in the sense that it gives you what you want if both H15 & H16 are zero, but also if one of them is zero as well.
    But it seems an odd way of writing the formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    would seem a more readable version, and will equally work as a MIN.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    01-15-2013
    Location
    Indianapolis, IN
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Min value to exclude zeros

    I agree it is much easier to read now. It is close, but if there is only one zero i need it to take the next highest number that is not zero. But if all the numbers in the row are zero then I would like the "-". Does that make sense?
    Last edited by jaarthur; 03-05-2013 at 02:43 PM.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Min value to exclude zeros

    Ahh!
    As so often happens a new consideration enters stage left to the delight of the audience.

    How about

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


    Which can probably be simplified but since I've just partaken of a couple of glasses of wine at dinner I'll leave that to others.

  5. #5
    Registered User
    Join Date
    01-15-2013
    Location
    Indianapolis, IN
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Min value to exclude zeros

    That works flawlessly!! Thank you so much...I do have one more question that you might be able to help me with though. Hopefully. So...

    I am now trying to average the averages. There are 5 averages and I am trying to get the total average of the data. Like my other question there are "-" in some of the cells. This particular data has all "-" because all of that column happened to have no data. This is the forumla that I currently have.

    =IF(AVERAGE(I33,I26,I18,I11,I4)=0,"-",AVERAGE(I33,I26,I18,I11,I4))

    It works if there is at least one number in the set of data but I would like the average to show "-" if all of the other averages are like that "-". Hope you can help?!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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