+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    02-15-2006
    Posts
    9

    Find minimum with criteria - "MINIF"

    Hello,

    I have following problem I have some table - 2 columns - in first is text in second is value.

    example:
    A 10
    B 5
    C 3
    A 15
    C 8
    D 7
    A 9

    I need to use formula, which shows me minimal value for choosen text.
    I tried matrix formula like {=min(if(text table=choosen text; second column;0}, but it's not working

    Any idea?

    Thanks in advance

    Zeman Martin
    Last edited by martyzeman; 12-10-2009 at 11:36 AM. Reason: SOLVED by DonkeyOte

  2. #2
    Valued Forum Contributor JeanRage's Avatar
    Join Date
    03-02-2009
    Location
    Nice, France
    MS-Off Ver
    Excel 2003
    Posts
    705

    Re: Find minimum with criteria - "MINIF"

    Hi,

    With an array ...(control+shift+enter)

    =MIN(IF(A1:A7=”A”,B1:B7))
    HTH
    Last edited by JeanRage; 12-10-2009 at 11:48 AM. Reason: forgot to type IF ...

  3. #3
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,379

    Re: Find minimum with criteria - "MINIF"

    JR, that won't work I'm afraid (unless all values in A1:A7 were A)

    Code:
    =MIN(IF(A1:A7="A",B1:B7))
    CSE

  4. #4
    Valued Forum Contributor JeanRage's Avatar
    Join Date
    03-02-2009
    Location
    Nice, France
    MS-Off Ver
    Excel 2003
    Posts
    705

    Re: Find minimum with criteria - "MINIF"

    Quote Originally Posted by DonkeyOte View Post
    JR, that won't work I'm afraid (unless all values in A1:A7 were A)
    Code:
    =MIN(IF(A1:A7="A",B1:B7))
    CSE
    THANKS ... for correcting ... forgot the IF

    Cheers

  5. #5
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,379

    Re: Find minimum with criteria - "MINIF"

    Still got some typos in your original which might be worth editing to avoid confusion.

    For sake of OP, the key in the MIN array is to ensure that the Array of values used contains numbers only where A1:A7 matches required value (else populate with Boolean) otherwise you're likely to get 0 return more often than not

    To illustrate using your sample data:

    Code:
    =MIN((A1:A7="a")*(B1:B7))
    will in essence evaluate to

    Code:
    =MIN({10;0;0;15;0;0;9})
    (ie TRUE/FALSE * number -> where FALSE this will result in 0)
    and the MIN of that array is obviously 0

    whereas

    Code:
    =MIN(IF(A1:A7="a",B1:B7))
    will evaluate to

    Code:
    =MIN({10;FALSE;FALSE;15;FALSE;FALSE;9})
    and the Booleans in this context (inline array) will be ignored - thus result is 9

  6. #6
    Registered User
    Join Date
    02-15-2006
    Posts
    9

    Thumbs up Re: Find minimum with criteria - "MINIF"

    thank You DonkeyOte works fine

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.2.0