+ Reply to Thread
Results 1 to 6 of 6

Lookup on Mult Match

  1. #1
    Forum Contributor day92's Avatar
    Join Date
    04-20-2010
    Location
    Los Angeles
    MS-Off Ver
    Excel 360
    Posts
    600

    Lookup on Mult Match

    Hi Guys - I'm trying to fix someone's mess in the office and got stuck. Now its my mess! What I'm trying to do is lookup values based on ID and DX number. I used a combination of index/match but I'm not getting the desired results.

    In the attached sheet on the Analysis tab im trying to fill in the values from column E to column L. The lookup criteria is based on the ID and the DX number. The problem im running into is that the DX number is in multiple columns in the data tab - the DX number is in column M-P on the data tab. I want to return the value is there is a match on the ID # and the DX in any of the those columns. The formula works for the first couple of the rows but in the 3rd row it is not working. There is a match on ID#10000 and DX number 272.4 in the data tab.

    Any thoughts?
    Attached Files Attached Files
    Last edited by day92; 08-27-2012 at 03:17 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Lookup on Mult Match

    Try:

    Please Login or Register  to view this content.
    or

    Please Login or Register  to view this content.
    Last edited by NBVC; 08-27-2012 at 02:31 PM.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Lookup on Mult Match

    day92,

    In 'Analysis' sheet cell G2 is this array formula copied over and down:
    Please Login or Register  to view this content.

    [EDIT]
    Looks like I got beat to it by NBVC. Nice use of MMULT btw, good way to avoid an array formula in this case. Didn't even occur to me
    Attached Files Attached Files
    Last edited by tigeravatar; 08-27-2012 at 02:35 PM. Reason: Added edit
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Forum Contributor day92's Avatar
    Join Date
    04-20-2010
    Location
    Los Angeles
    MS-Off Ver
    Excel 360
    Posts
    600

    Re: Lookup on Mult Match

    NBVC - you never sees to amaze! Couple of questions -

    - Ive never seen the MMULT formula, how does that work?
    - why do you put the 1 after the match function?

    TA - thanks for your help too!

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Lookup on Mult Match

    It's really hard for me to explain....

    As per the definition of the function MMULT by MS in Excel help:

    Returns the matrix product of two arrays. The result is an array with the same number of rows as array1 and the same number of columns as array2.
    So Array1 is 4 columns by 75 rows (your table) and Array2 is 1 column by 4 rows (the virtual table {1;1;1;1}) to get a result of 75 rows by 1 column... each of these rows is the result of testing each element of each row against criteria M2. So a a match is considered when any of these row results has a value greater than 0... since the -- converts TRUE/FALSE to 0/1... coincidentally the formula as it stands will only work if there is one exact match of Dx number in the 4 columns... the better formula might be:
    Please Login or Register  to view this content.
    The Match(1,... then checks for the first 1 in the array produced by multiplying the 2 criteria (Data!$A$2:$A$75=$A2) and (MMULT(--(Data!$M$2:$P$75=$M2),{1;1;1;1})>0) together (remember that TRUE*TRUE=1 and all other combos = 0).

    I suggest you change the 75's to 7's temporarily, and use the formula Evaluation tool to better see the concept in action without too much elements...

  6. #6
    Forum Contributor day92's Avatar
    Join Date
    04-20-2010
    Location
    Los Angeles
    MS-Off Ver
    Excel 360
    Posts
    600

    Re: Lookup on Mult Match

    OK that makes sense. Thanks again.

+ 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