+ Reply to Thread
Results 1 to 10 of 10

Index Matrix not returning correct value

Hybrid View

  1. #1
    Registered User
    Join Date
    11-23-2017
    Location
    Germany
    MS-Off Ver
    2019
    Posts
    51

    Index Matrix not returning correct value

    Hi guys,

    I have a simple index(matrix function but it does not return the desired value. It seems to combine the lookup values in a way.

    For
    grade 11 step 01 it returns value from
    grade 01 step 11, for
    grade 11 02 it returns value from
    grade 01 step 12 and so on

    The simplified file is attached.

    Does anyone have an idea?

    Many thanks!
    Attached Files Attached Files
    Last edited by JasXel; 02-08-2018 at 06:59 AM.

  2. #2
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Index Matrix not returning correct value

    yes you do matches on the numbers not the formats

    a1 is 1 and b1 is 11 so you match 111 for your first match which is in row 3, if you make the first 2 columns text, not numbers they should work

  3. #3
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,944

    Re: Index Matrix not returning correct value

    You have formatted cells that's why the problem occures
    try below array formula in E8 and copy towards down
    =INDEX(C:C,MATCH(TEXT(A8,"00")&TEXT(B8,"00"),TEXT(A$1:A$100,"00")&TEXT(B$1:B$100,"00"),0))
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  4. #4
    Registered User
    Join Date
    11-23-2017
    Location
    Germany
    MS-Off Ver
    2019
    Posts
    51

    Re: Index Matrix not returning correct value

    Quote Originally Posted by nflsales View Post
    You have formatted cells that's why the problem occures
    try below array formula in E8 and copy towards down
    =INDEX(C:C,MATCH(TEXT(A8,"00")&TEXT(B8,"00"),TEXT(A$1:A$100,"00")&TEXT(B$1:B$100,"00"),0))
    Thanks a lot! This worked!

    I still do not understand the problem. In the formula I say look for 11 in column A and for 01 in column B. Excel returns value for 01 from column A and 10 from column B. Why is that? Even if my number format is always 2 digits, leaving the leading 0 out it still makes no sense. I say look for 11 in A and 1 in B and excel returns 1 from A and 10 from B.. HUH? Why?

    Thanks!

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Index Matrix not returning correct value

    An alternative would be to deconcatenate your MATCH, like this ordinary formula:

    =INDEX($C$2:$C$12,MATCH(1,INDEX(($A$2:$A$12=A8)*($B$2:$B$12=B8),),0))
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,981

    Re: Index Matrix not returning correct value

    On iPad so can't see your formula. However, it sounds as though you have your MATCH functions the wrong way round. The function is =INDEX(range, row, column). I think you have =INDEX(range, column, row)
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  7. #7
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,944

    Re: Index Matrix not returning correct value

    if you see in cell A2 to A7 are looks like 01 but actually they are 1 s you can see the value of cell A2 in the formula ba.
    so when you combines A3&B3 the value is 1&11 i,e 111 like that for A8&B8 the value is 11&1 i,e 111 hence A3&B3 = A8&B8
    so that you format picks the wrong value.

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Index Matrix not returning correct value

    When you concatenate the columns... row 3 is read as 1+11=111. Row 8 is read as 11+1 = 111. Index returns the value from C corresponding to the first 111 that it sees. You need to ensure that the extra digits, added by your formatting, are retained to get the correct result. That is what nflsales' formula does.

  9. #9
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,203

    Re: Index Matrix not returning correct value

    One way:

    =INDEX($C$1:$C$100,MATCH(A8&"|"&B8,INDEX($A$1:$A$100&"|"&$B$1:$B$100,0),0))
    Last edited by Phuocam; 02-08-2018 at 06:44 AM.

  10. #10
    Registered User
    Join Date
    11-23-2017
    Location
    Germany
    MS-Off Ver
    2019
    Posts
    51

    Re: Index Matrix not returning correct value

    OK, I understood now (PUH) Thanks everyone!

+ 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. Index and Match formula not returning correct values
    By rcdavis28 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-13-2016, 05:25 PM
  2. [SOLVED] Index Match formula not returning correct results
    By JennOlsen in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-30-2015, 02:59 PM
  3. Replies: 3
    Last Post: 12-17-2014, 02:05 PM
  4. [SOLVED] Returning a value in a matrix
    By Stuck14 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-13-2014, 11:16 AM
  5. [SOLVED] IFERROR+INDEX+MATCH Formula is not returning the correct value
    By bxk006 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-16-2013, 09:50 AM
  6. Returning the value from another matrix sheet
    By dilse in forum Excel General
    Replies: 3
    Last Post: 06-02-2011, 03:01 AM
  7. Formula sometimes returning correct answer and sometimes returning 0
    By redimp in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-09-2010, 06:28 AM

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