+ Reply to Thread
Results 1 to 5 of 5

Finding the largest value in an array which does not correspond to x

  1. #1
    Registered User
    Join Date
    08-16-2010
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Excel 2003
    Posts
    5

    Finding the largest value in an array which does not correspond to x

    Hi,

    I'm trying to find the largest number which does not correspond to x which in my case equals 2958465 conditioned that the cells in H corresponds to a certain number. I tried to solve it via choosing the 2nd largest number, knowing that 2958465 would always be the largest. This however, did not work, seeing as in some cases there may be 4 or 5 of the cells with the condition that corresponds to 2958465.

    My formula thus far, which works if there are one or two cells which corresponds to 2958465, is as follows:

    {=IF(B39="";"";IF(MAX(IF($H$4:$H$2500=H39;$N$4:$N$2500))=2958465;LARGE(IF($H$4:$H$2500=H39;$N$4:$N$2500);2);IF(LARGE(IF($H$4:$H$2500=H39;$N$4:$N$2500);2)=2958465;LARGE(IF($H$4:$H$2500=H39;$N$4:$N$2500);5);MAX(IF($H$4:$H$2500=H39;$N$4:$N$2500)))))}

    Seeing as this does not work in all cases, it would be great if someone could help me with a formula which simply returns the largest number in an array which does not correspond to 2958465.

    Thank you in advance!

    M
    Last edited by mac8528; 01-03-2012 at 09:09 AM.

  2. #2
    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: Finding the largest value in an array which does not correspond to x

    Hi

    I think the simplest way to do this, is using a helper column.

    Let's say that your values are in column H. Then in the helper column(COLUMN l, for example), put the formula:>>=IF(H1=2958465;"";H1)

    So using the simple function>>>=MAX(I:I), YOU HAVE YOUR RESULT.

    Hope to helps you
    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.

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Finding the largest value in an array which does not correspond to x

    =LARGE(H1:H30,COUNTIF(H1:H30,g1)+1) where g1 =2958465
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    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: Finding the largest value in an array which does not correspond to x

    There is always a better way..!

    Well done Martin

  5. #5
    Registered User
    Join Date
    08-16-2010
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Finding the largest value in an array which does not correspond to x

    Thanks a lot guys!

+ 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