Solved

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

Posted on 2016-10-03
6
30 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now