+ Reply to Thread
Results 1 to 4 of 4

max value into an array and index

  1. #1
    Registered User
    Join Date
    01-14-2008
    Posts
    21

    max value into an array and index

    Hi there !
    Hope somebody could help me.
    I don’t know if I am looking for the more complex solution, but I’ll try.
    I am getting different results from a routine called into a for cycle.
    These results are stored in some arrays.
    Let’s say
    Result1(i)
    Result2(i)
    Resultn(i)

    At the end, if the cycle is called from 1 to k, I will have n x k results.

    I’d like to realize a routine capable of
    1 - identifying the max of result1 among all the k result1,
    and
    2 - extracting the index i so that I can access to the other results of this index, as Result2, Resultn.

    ex, should Result1(4) be the max of result1, I'd like to
    - get the 4, so that I can access to Result2(4), Resultn(4)...

    Please, has anybody any idea of how to do it ?


    Thanks in advance !

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: max value into an array and index

    A non VBa way might be to use MATCH() to get the required index.
    Then use INDEX(Match()) to get the corresponding values in the other arrays/ranges.

    See the attached.
    Does this help?
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  3. #3
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: max value into an array and index

    The Go Advanced option when Editing a post seems to be broken, so I can't just change the attachment, I have added C/F to this example to make it easier to follow.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    01-14-2008
    Posts
    21

    Re: max value into an array and index

    Hello, many thanks Mr. Marcol.
    As a matter of fact I was looking for a way to implement in a VBA code.

    Please, do you know how to do ?

    Many thanks

+ 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