Forum Discussion

Corey McCool's avatar
Corey McCool
Copper Contributor
Jul 05, 2018
Solved

Index Match Error

Hello,

 

In a tab marked "MRP" I have parts list.  In that tab, I'm trying to fill the "Description" column (C) by pulling the value from another tab labeled "PRICING", column E.

 

I'm using this formula:  =INDEX(PRICING!$A$1:$H$427,MATCH(A2,PRICING!$A$1:$H$427,0),5)

 

So ... it should index the entire pricing tab, find "A2", which is a part number listed in the "MRP" tab, and return the value in the 5th column of that row.     Instead, I get a #NA error. What am I missing here?

 

Thank you for your help!

  • Hi Corey,

     

    The lookup_array in MATCH function must be a one-dimensional array!

     

    This is the fix:

    =INDEX(PRICING!$A$1:$H$427,MATCH(A2,PRICING!$A$1:$A$427,0),5)

     

    You can also use VLOOKUP function as an easy alternative to INDEX/MATCH combination as follows:

    =VLOOKUP(A2,PRICING!$A$1:$H$427,5,0)

     

    Hope that helps

    Regards

2 Replies

  • Haytham Amairah's avatar
    Haytham Amairah
    Silver Contributor

    Hi Corey,

     

    The lookup_array in MATCH function must be a one-dimensional array!

     

    This is the fix:

    =INDEX(PRICING!$A$1:$H$427,MATCH(A2,PRICING!$A$1:$A$427,0),5)

     

    You can also use VLOOKUP function as an easy alternative to INDEX/MATCH combination as follows:

    =VLOOKUP(A2,PRICING!$A$1:$H$427,5,0)

     

    Hope that helps

    Regards

    • Corey McCool's avatar
      Corey McCool
      Copper Contributor

      Thank you!

       

      I ran into the same error with your first response, but keeping it simple and using VLOOKUP instead did the job.  I changed my approach to this spreadsheet and never considered going back to VLOOKUP.  Thanks for your help!

Resources