+ Reply to Thread
Results 1 to 7 of 7

Ignoring zero values in min and max functions - non contiguous cells

  1. #1
    Registered User
    Join Date
    11-02-2011
    Location
    Seattle, Washington, USA
    MS-Off Ver
    Excel 2010
    Posts
    9

    Ignoring zero values in min and max functions - non contiguous cells

    I have a very large data sheet and I need to find the max and min of various cells in a row. These cells are not contiguous, and I need to ignore zero values. If i were to simply need a min of these cells the formula would be as follows:

    =MIN(D4,G4,M4,S4,Y4,AE4,AK4,AQ4,AW4,BC4,BI4)

    Because this formula needs to go down the entire 800 rows of this report I can't do it by hand.

    Excel 2010.

    Thanks!

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Ignoring zero values in min and max functions - non contiguous cells

    Hi Milleribsen, welcome to the forum.

    Based on pgc01's first post in this thread (http://www.mrexcel.com/forum/showthread.php?t=226575) this formula should hopefully work for you.

    Please Login or Register  to view this content.
    If you have hundreds of cells, though, it may get quite long and a macro would work better.

    Hope it helps!

  3. #3
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Ignoring zero values in min and max functions - non contiguous cells

    If your range is D4:BI4 then try =MIN(IF(D4:BI4<>0,D4:BI4)) entered as an array formula (i.e. using Ctrl-Shift-Enter).

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Ignoring zero values in min and max functions - non contiguous cells

    I assumed that the range was non-contiguous and that there were other numbers in the row that needed to be excluded (which is why you were averaging individual cells).

    If that's not the case, Andrew's formula is much simpler as it will only look at numeric cells, and exclude any that have a zero value. The Average function also excludes blank (unused) cells.

  5. #5
    Registered User
    Join Date
    11-02-2011
    Location
    Seattle, Washington, USA
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Ignoring zero values in min and max functions - non contiguous cells

    You're correct, there are other value numbers in the row. I'll take a look at both options and hopefully something will work!

  6. #6
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Ignoring zero values in min and max functions - non contiguous cells

    Is there something in the headers for each row that you could look at?

    For example, this formula returns the minimum values of row 4 looking only at cells where there is an X in row 1.

    =MIN(IF(D$1:BI$1="X",D4:BI4))

    As before it's an array formula.

  7. #7
    Registered User
    Join Date
    11-02-2011
    Location
    Seattle, Washington, USA
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Ignoring zero values in min and max functions - non contiguous cells

    This appears to have worked! Thank you so much! I had stumped all of my company's analysts on this one.

+ 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