Forum Discussion
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 AmairahSilver 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 McCoolCopper 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!