+ Reply to Thread
Results 1 to 7 of 7

Min/Max of an array

Hybrid View

  1. #1
    Registered User
    Join Date
    06-11-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    20

    Min/Max of an array

    I am using the following formaula to try and find the max number when a certain condition is met.
    =MAX(IF($L$14:$L$194=F5,$J$14:$J$194,0))

    However it seems that because the number is negative it defaults to 0, can anyone tell me why this is? and also help with a solution.

    Thanks

  2. #2
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: Min/Max of an array

    =max(if($l$14:$l$194=f5,$j$14:$j$194))
    Regards

    tom1977

    If You are satisfied with my solution click the small star icon on the left to say thanks.

  3. #3
    Valued Forum Contributor
    Join Date
    04-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    547

    Re: Min/Max of an array

    You are trying to find the maximum of a range of negative numbers and 0. So 0 will always be bigger than the negative numbers. Instead of 0 in the IF statement, use an obscenely big negative number, for example

    =MAX(IF($L$14:$L$194=F5,$J$14:$J$194,-99^99))

    or drop the FALSE argument altogether, because it is not needed.

    =MAX(IF($L$14:$L$194=F5,$J$14:$J$194))
    Like a post? Click the star below it!

  4. #4
    Registered User
    Join Date
    06-11-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Min/Max of an array

    Great, thank you. It works!

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Min/Max of an array

    Hi

    Try

    =MAX(IF($L$14:$L$194=F5,J$14:$J$194))
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  6. #6
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Min/Max of an array

    Try this regular formula...
    =MAX(INDEX(($L$14:$L$194<>F5)*-10^99+$J$14:$J$194,0))
    Does that help?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  7. #7
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Min/Max of an array

    Really, nice one, Ron.

+ 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