+ Reply to Thread
Results 1 to 6 of 6

Find position in matrix (not array)

  1. #1
    Forum Contributor
    Join Date
    10-11-2008
    Location
    Portugal
    MS-Off Ver
    Excel 2010
    Posts
    111

    Find position in matrix (not array)

    Hi,

    How can I find the position of an item in a matrix? The function MATCH only works with arrays, not matrices... I want to know both line and column relative position

    Thanks
    Last edited by Coaster; 03-18-2010 at 01:27 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Find position in matrix (not array)

    MATCH will only work with Vectors.

    Returning the address in one cell is a relatively expensive process, generally it's best to split into two to reduce workload:

    A2: =MIN(IF(B1:D100=A1;COLUMN(B1:D1)+(ROW(B1:B100)/1000000)))
    confirmed with CTRL + SHIFT + ENTER

    A3: =ADDRESS(MOD(A2,1)*1000000;INT(A2))
    confirmed with Enter

    The Array will return first match based on Column - ie A50 would be found before B4
    If you want ROW to precede COLUMN (ie find B4 before A50) then switch COLUMN & ROW in the Array and modify subsequent ADDRESS function accordingly.

  3. #3
    Forum Contributor
    Join Date
    10-11-2008
    Location
    Portugal
    MS-Off Ver
    Excel 2010
    Posts
    111

    Re: Find position in matrix (not array)

    tks for the explanation!

    however, I need more help. I got that to work but now I don't know what to do with it to do what I want to do...I'll attach an .xls file so you can understand what I want.

    Thanks
    Attached Files Attached Files

  4. #4
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Find position in matrix (not array)

    =max(index((c5:j11=c16)*b5:b11,))&b4&max(index((c5:j11=c16)*c4:j4,))

  5. #5
    Forum Contributor
    Join Date
    10-11-2008
    Location
    Portugal
    MS-Off Ver
    Excel 2010
    Posts
    111

    Re: Find position in matrix (not array)

    worked perfectly! thanks

  6. #6
    Registered User
    Join Date
    06-28-2011
    Location
    Bristol, UK
    MS-Off Ver
    Excel 2010, 2013, 2016, 365
    Posts
    79

    Re: Find position in matrix (not array)

    Quote Originally Posted by Teethless mama View Post
    =max(index((c5:j11=c16)*b5:b11,))&b4&max(index((c5:j11=c16)*c4:j4,))
    Hi this is a really interesting formula, not one I've come across before -- can anyone give a little bit more explanation about how the index function is working here? 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