+ Reply to Thread
Results 1 to 3 of 3

Min if and

  1. #1
    Registered User
    Join Date
    04-17-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    28

    Min if and

    My formula isn't working and I need some help. I'm trying to return the minimum value of one column based on the value of another. Ihave two sheets in my workbook: Data and Tables. The formula is in Tables

    {=MIN(IF(AND(Data!$O$2:$O$6141="yes",Data!$R$2:$R$6141=J3),Data!$N$2:$N$6141))}

    For Example

    Sheet: Data

    ColumnO ColumnN ColumnR
    Yes 100 Red
    No 50 Blue
    Yes 120 Red

    Sheet: Tables
    J3 = Red

    It should return 100, but instead I get nothing. WHat am I doing wrong?

    --John
    Last edited by Johnny Image; 08-02-2012 at 04:47 PM.

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

    Re: Min if and

    Try it like this:

    {=MIN(IF((Data!$O$2:$O$6141="yes")*(Data!$R$2:$R$6141=J3),Data!$N$2:$N$6141))}

    You can't use AND like that to work on arrays, but * is equivalent. Obviously, don't type the { } - use CSE to commit.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    04-17-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Min if and

    Quote Originally Posted by Pete_UK View Post
    Try it like this:

    {=MIN(IF((Data!$O$2:$O$6141="yes")*(Data!$R$2:$R$6141=J3),Data!$N$2:$N$6141))}

    You can't use AND like that to work on arrays, but * is equivalent. Obviously, don't type the { } - use CSE to commit.

    Hope this helps.

    Pete
    That worked!! Thanks for the help and the lesson. I don't use arrays often enough to know the in and outs.

    --John

+ 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