Solved

Excel 2013 - Index Match Array Formula NOT Returning Expected Results.

Posted on 2016-10-03
6
40 Views
Last Modified: 2016-11-09
Hello,

My INDEX, MATCH Array formula keeps returning the wrong information.  Hopefully this will give enough information to explain the situation without getting lost in the weeds.

I have a workbook containing 2 sets of Bill of Materials data.

Details:  
Worksheet 1 - 12,000 lines of Data - (Child PN can potentially be used in any of the 10 BOM levels, so I created a running total column to count instances of occurrence)

Worksheet 2 - 18,000 lines of data -

      Sheet 1                              
      Table Name:  tblCurrentData                              
Model      Parent      Child      Qty      Data Point      ModParChildRunCount      Running Count of ModParChild
Loki      Zeus      Icarus      17      Sam, Bill, Dave      Loki - Zeus - Icarus - 1      1
Medusa      Cyclops      Thebes      3      Ed, Alex, Al      Medusa - Cyclops - Thebes - 1      1
Loki      Zeus      Icarus      50      Jim, Fred, Barney, Lester      Loki - Zeus - Icarus - 2      2
                                    
      Sheet2                              
      Table Name:  tblTransferData                              
Model      Parent      Child      Qty      Data Point      ModParChildRunCount      Running Count of ModParChild
Loki      Zeus      Icarus      50      Jim, Fred, Barney, Lester      Loki - Zeus - Icarus -1      1
Medusa      Cyclops      Thebes      88      Ed, Alex, Al      Medusa - Cyclops - Thebes - 2      1
Loki      Zeus      Icarus      17      Sam, Bill, Dave      Loki - Zeus - Icarus - 2      2
                                    
      Array Formula on Sheet 2 (cell G2):  =INDEX(tblCurrentData,MATCH(ModParChildRunCount,tblCurrentData[ModParChildRunCount],0),4)                              
      Array Formula on Sheet 2 (cell H2):  =INDEX(tblCurrentData,MATCH(ModParChildRunCount,tblCurrentData[ModParChildRunCount],0),5)                              
      
So the results seem to be backwards:                              
      Results from G2 Array lookup (for Loki - Zeus - Icarus - 1)                        50      Jim, Fred, Barney, Lester
      Results from H2 Array lookup (for Loki - Zeus - Icarus - 2)                        17      Sam, Bill, Dave

I would expect to see:  Loki - Zeus - Icarus - 2 to return 50 and Jim, Fred, Barney, Lester.  NOT 17, Sam, Bill, Dave.

Any ideas?

Thank you all for your help!
0
Comment
Question by:Blistered Pawn
  • 3
  • 2
6 Comments
 
LVL 23

Assisted Solution

by:NBVC
NBVC earned 500 total points
ID: 41826583
The formula looks right.  It should return first "exact match".  Check if there any leading/trailing spaces in the indexed column where you think the match should happen.
0
 
LVL 23

Expert Comment

by:NBVC
ID: 41826586
The only other way to diagnose is for you to post an actual workbook so we can see what is wrong.
0
 

Author Comment

by:Blistered Pawn
ID: 41826935
Hello Gurus,

If you look at the attached file you can see the lookup issue.  Please See "Screenshot Explanation Tab".

I created "helper fields" in columns G-H on Sheet1. (Columns F-H on Sheet2)

Sheet1 Contains Table named "tblBOMData"
Sheet2 Contains Table named "tblImportData"

For a Match between both tabs on Column I--the Index Match Array is pulling in opposite quantities.  

Pulling in reverse information:
Sheet1 BOMData for record = LarryMoeCurly^HAT2GEJ101X^1 is Qty of 53.  Formula is pulling in QTY of 13 and corresponding ImportData DataPoints
Sheet1 BOMData for record = LarryMoeCurly^HAT2GEJ101X^2 is Qty of 13.  Formula is pulling in QTY of 53 and corresponding ImportData DataPoints

Any help is immensely appreciated.

Regards.
Index-Match-Issue.xlsx
0
 
LVL 23

Accepted Solution

by:
NBVC earned 500 total points
ID: 41826994
I think it has to do with your sort... in your Sheet 2, Qty of 53 comes after Qty of 13.  In your Sheet 1, it is the reversed.  The MATCH() looks for exact match of what you have in column I of Sheet1.

My suggestion is either to change the sort order so both sheets are same sort... or you can add the Qty to your concatenations so now you will be more precise in search.
0
 

Author Comment

by:Blistered Pawn
ID: 41828118
Hello NBVC.  Thank you for your reply and ideas.

Sorting both sheets in the same order did not seem to help the INDEX/MATCH formula.  Also, unfortunately, some quantities in Sheet1 are incorrect.  Sheet2 quantities however, are correct.  

So, that wouldn't provide for consistent matching.

Any other ideas?  I posted a new question about the possibility of sorting the text contents of a cell in alphabetical order.  Hoping to get an answer there with the idea of being able to concatenate the DataPoint columns for the INDEX/MATCH.

Thank you.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question