+ Reply to Thread
Results 1 to 8 of 8

Min function ignoring zero values - non contiguous cells

  1. #1
    Registered User
    Join Date
    12-30-2016
    Location
    Copenhagen, Denmark
    MS-Off Ver
    MS Office 2013
    Posts
    3

    Min function ignoring zero values - non contiguous cells

    I need to create a function that finds the minimum value from several non-contiguous cells while also excluding the values of zero.

    The case is: I want to find the minimum value from 8 non-contiguous cells (not difficult), but the difficult part is to exclude the values of zero and only have the function return the value larger than 0.
    MS Office 2013 is used.

    Additionally I have a similar case, where I want to find the minimum from 8 non-contiguous cells all in different worksheets all still in the same Excel file (not difficult), but again also excluding the values of zero.
    I guess the same solution would apply to both cases.

    Thanks!

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,076

    Re: Min function ignoring zero values - non contiguous cells

    Cant you copy the values into a column, say A1:A8
    then use the usual

    =MIN(IF(A1:A8<>0,A1:A8))
    Array formula
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    12-30-2016
    Location
    Copenhagen, Denmark
    MS-Off Ver
    MS Office 2013
    Posts
    3

    Re: Min function ignoring zero values - non contiguous cells

    Excel.PNG

    In theory I could, but the data is way too extensive, so columns is not an option.

    I have attached a picture of the sheet. In AF9 the 37% is correct, but only because I have not included the R33, highlighted in yellow. I want to include R33, but have the function exclude it because it is zero. Without this exclusion in the function it will include the 0 in R33 and always return 100% as a result.

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Min function ignoring zero values - non contiguous cells

    Hi,

    Your cells are regularly spaced so you can use OFFSET for this example
    =AF5-MIN(IF(N(OFFSET(R5;(ROW(INDIRECT("1:8"))-1)*4;0))<>0;N(OFFSET(R5;(ROW(INDIRECT("1:8"))-1)*4;0))))

    This must be array entered.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  5. #5
    Registered User
    Join Date
    12-30-2016
    Location
    Copenhagen, Denmark
    MS-Off Ver
    MS Office 2013
    Posts
    3

    Re: Min function ignoring zero values - non contiguous cells

    Hi,

    This does unfortunately not work. The cells are regularly spaced, but as I have six different tabes of information below each other the results returned are not correct.

    Any other ideas on how to make the function work?

    Thanks!

  6. #6
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Min function ignoring zero values - non contiguous cells

    The function does work- I know that because I have tested it. It may require adjusting for the layout of your workbook, which I cannot do without knowing that layout.

  7. #7
    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 function ignoring zero values - non contiguous cells

    I think you'll need to upload the workbook for further progress.
    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.

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: Min function ignoring zero values - non contiguous cells

    It's difficult to see the formula in your picture, but I think you have this:

    =(AF5-MIN(R5,R9,R13,R17,R21,R25,R29))/AF5

    (Note that I'm using commas, rather than semicolons).

    If that is the case then you can change the formula to this:

    =(AF5-MIN(IF(R5=0,"",R5),IF(R9=0,"",R9),IF(R13=0,"",R13),IF(R17=0,"",R17),IF(R21=0,"",R21),IF(R25=0,"",R25),IF(R29=0,"",R29),IF(R33=0,"",R33)))/AF5

    and I've added the R33 term in for you.

    Hope this helps.

    Pete

+ 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. Standard Deviation of non-contiguous range while ignoring 0s
    By morbdetro in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-20-2015, 02:22 PM
  2. Replies: 1
    Last Post: 08-14-2014, 12:27 AM
  3. [SOLVED] copy and paste from contiguous cells to non-contiguous cells using the = function
    By shameus in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-05-2013, 06:48 PM
  4. [SOLVED] How to sum non-contiguous columns applied as a formula on contiguous cells
    By figo12 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-09-2013, 01:07 PM
  5. Min of a non contiguous range of cells and ignoring Zero values
    By witchcraftz in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-20-2013, 07:34 PM
  6. Replies: 6
    Last Post: 11-03-2011, 05:11 PM
  7. Function to count non-contiguous cells in a column and sums the cells
    By Ace of Clubs in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-24-2009, 06:34 AM

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