+ Reply to Thread
Results 1 to 6 of 6

Conditional Min of values in an array based on a value in D1

  1. #1
    Registered User
    Join Date
    03-31-2012
    Location
    Lumbabo
    MS-Off Ver
    Excel 2010
    Posts
    4

    Conditional Min of values in an array based on a value in D1

    I am having the following problem which I would like to solve using only excel functions without resorting to programming in vba or macros or manual commands.

    I have a list of numbers in an array (a1:a70) and I am looking for the minimal number in that array that satisfies some conditions, the conditions are such that they might exclude some cells in the array. Cells in the array are excluded if their values are higher than a value stored in cell D1.
    The ideal solution would have been a function like MINIF(range,condition) but such a function does not exist for MIN (it exists for counting COUNTIF, SUMIF, ...)

    How do I achieve the same result using other EXCEL functions?

    Keep in mind that the array length and the conditions change dynamically during the run.

  2. #2
    Registered User
    Join Date
    03-31-2012
    Location
    Lumbabo
    MS-Off Ver
    Excel 2010
    Posts
    4

    Minimal value in an array using the value in another cell

    I have a list of numbers in an array (a1:a70).

    I am looking for the minimal number in that array that satisfies some conditions, the conditions are such that they might exclude some cells in the array.

    In my particular case cells in the array are excluded if their values are higher than a value stored in cell D1.

    The ideal solution would have been a function like MINIF(range,condition) but such an EXCEL function does not exist for MIN (it exists for counting COUNTIF, SUMIF, ...)

    How do I achieve the same result using other EXCEL functions?

    Keep in mind that the array length and the conditions change dynamically during the run.


    Thanks for your help

  3. #3
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Minimal value in an array using the value in another cell

    if i understand you correctly, attached Banino1234_min_val_meeting_condn_31mar12_01.PNG may be something that might work, see if it helps.

    i hasten to add - this is an array formula that is confirmed with CTRL+SHFT+ENTER, instead of just ENTER.
    Last edited by icestationzbra; 03-31-2012 at 09:14 PM.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Conditional Min of values in an array based on a value in D1

    Try something like this...

    =MIN(IF(A1:A70<D1,A1:A70))

    This is an array formula. When you enter in the formula, use Ctrl+Shift+Enter. Excel will automatically surround the formula with {braces}.


    Though I'm at a loss understanding your criteria. If the min value in A1:A70 is less than D1, then any value greater than D1 cannot be the minimum. So this would do the same thing for your criteria.

    =IF(MIN(A1:A70)<D1,MIN(A1:A70),0)

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Minimal value in an array using the value in another cell

    A non-array alternative for this specific example would be:

    Please Login or Register  to view this content.
    If your criteria are more convoluted that this example then invariably an Array is the way to go (as previously outlined).
    Last edited by DonkeyOte; 04-01-2012 at 02:46 AM. Reason: LARGE rather than SMALL

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Conditional Min of values in an array based on a value in D1

    Welcome to the Forum, please ask a question once only.

    On this occasion, give separate responses, threads merged.

+ 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