Horizontal and vertical double MATCH function to derive a value via INDEX

JohnMense

New Member
Joined
Jan 26, 2015
Messages
14
Office Version
  1. 365
Platform
  1. Windows
I have looked at other posts about this and I understand the concept of using MATCH 2x for row and column but when I then use it to try and derive a specific value with INDEX it just isn't working out.

As per attached image I have some raw data of a site location and a project code as per top of image. I then want to derive the 'Product' from the table in the bottom part of the image by:
- MATCH the "Location" in table: MATCH(A$2,$B$13:$D$13,0)
- MATCH the "Code" from the list in the table for the specific site above
- INDEX to derive the Product name

I was thinking the following would work but it comes back as an error:
=INDEX(Sheet1!$A$14:$A$21,MATCH($A2,Sheet1!$B$13:$D$13,0),MATCH(B$2,Sheet1!$B$14:$D$21,0))

Same if I flip the 2 MATCH functions....

If anyone can enlighten me I would appreciate it!
 

Attachments

  • Excel issue.png
    Excel issue.png
    27.9 KB · Views: 31

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Try
Excel Formula:
=INDEX(A14:A21,MATCH(B2,INDEX(B14:D21,,MATCH(A2,B13:D13,0)),0))
 
Upvote 0
Solution
@Fluff
1: Formula works great, much appreciated! I see the logic too.
2: Account details updated (365)

Thanks again, this forum has saved my butt on a few occasions.
 
Upvote 0
Oddly I can't get that command to work right with no matter how I try to add fixed references ($). When I get to the 3rd line I get a #SPILL! error which also shows on the 4th line but then from 5 onwards it gives the right reference again. I cannot determine why.

I got it down to the following but get the error I mention above: FILTER(A$14:A$21,FILTER(B$14:D$21,B$13:D$13=A2,"")=B2,"")

No matter though as the first solution does the job.
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,957
Messages
6,175,622
Members
452,661
Latest member
Nonhle

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top