+ Reply to Thread
Results 1 to 2 of 2

Function that creates matches from an array

  1. #1
    Forum Contributor
    Join Date
    07-15-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    129

    Function that creates matches from an array

    Hi guys,

    The attached workbook is a score card that is trying to match up people based on their score. People with similar scores need to be matched together.

    So I'm trying to write a function that does the following:

    1. Finds the largest number in the array B2:G2
    2. Finds the second largest number in the array B2:G2
    3. Outputs both codes that title the columns (the codes in row 1) that these two numbers are in (i.e. matches the corresponding codes together)
    4. Finds the third largest number in the array B2:G2
    5. Finds the fourth largest number in the array B2:G2
    6. Outputs both codes that title the columns that these two numbers are in (i.e. matches the corresponding codes together)
    7. Finds the fifth largest number in the array B2:G2
    8. Finds the sixth largest number in the array B2:G2
    9. Outputs both codes that title the columns that these two numbers are in (i.e. matches the corresponding codes together)




    Game Data.xlsx

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Function that creates matches from an array

    How do you propose to break ties? The second and third highest values are the same.

    The array formula =INDEX($B$1:$G$1,LARGE(IF(LARGE($B$2:$G$2,ROW(A1))=$B$2:$G$2,COLUMN($A$2:$F$2)),ROW(A1))) pulls the first match of the nth largest value, whereas the non-arrray =LOOKUP(2,1/(LARGE($B$2:$G$2,ROW(A1))=$B$2:$G$2),$B$1:$G$1) aligns to the last match of the nth largest value.

    For example:

    First Match
    =INDEX($B$1:$G$1,LARGE(IF(LARGE($B$2:$G$2,ROW(A1))=$B$2:$G$2,COLUMN($A$2:$F$2)),ROW(A1))) = F1 = 7
    =INDEX($B$1:$G$1,LARGE(IF(LARGE($B$2:$G$2,ROW(A2))=$B$2:$G$2,COLUMN($A$2:$F$2)),ROW(A2))) = B1 = 5

    Last Match
    =LOOKUP(2,1/(LARGE($B$2:$G$2,ROW(A1))=$B$2:$G$2),$B$1:$G$1) = F1 = 7
    =LOOKUP(2,1/(LARGE($B$2:$G$2,ROW(A2))=$B$2:$G$2),$B$1:$G$1) = D1 = 5
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] INDEX MATCH array formula that matches substring n gives multiple matches
    By bkwins in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-12-2013, 04:57 AM
  2. Replies: 0
    Last Post: 10-13-2012, 10:13 PM
  3. Replies: 6
    Last Post: 05-26-2012, 04:56 AM
  4. Array Function- To find matches in two colums
    By Heather.Taylor in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-30-2011, 04:59 PM
  5. minimum along rows:creates an array
    By [email protected] in forum Excel Formulas & Functions
    Replies: 39
    Last Post: 09-06-2005, 09:05 PM

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