Vertical then Horizontal MATCH lookup array formula

jdm917

New Member
Joined
Sep 30, 2015
Messages
4
Greetings,

I am hoping someone in this forum can help me with this as I am stumped. I need to write an array formula that first evaluates against a vertical column of values and then finds a different value in the row of that vertical value. This sounds simple to do with INDEX - MATCH, but I actually need the formula to return the column reference after the horizontal lookup AND to add a little more complexity, the horizontal value I'm looking for can appear multiple times in the same row, so I need the formula to return all results. Here's a visual example, hopefully it clarifies what I'm talking about:

Column 1Column 2Column 3Column 4
AAAXYZ
BBBXYX
CCCYYZ

<tbody>
</tbody>

Vertical Lookup: BBB
Horizontal Lookup: X
Need the formula to return: 2 and 4

Hopefully, that explains what I need, thank you for your help!
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Let A1:D3 house the data.

A5: BBB
A6: X

In A7 control+shift+enter, not just enter, and copy down:
Rich (BB code):

=IFERROR(SMALL(IF(INDEX($A$1:$D$3,MATCH(A$5,$A$1:$A$3,0),0)=A$6,
    COLUMN($A$1:$D$3)-COLUMN($A$1)+1),ROWS(A$7:A7)),"")
 
Upvote 0
Let A1:D3 house the data.

A5: BBB
A6: X

In A7 control+shift+enter, not just enter, and copy down:
Rich (BB code):

=IFERROR(SMALL(IF(INDEX($A$1:$D$3,MATCH(A$5,$A$1:$A$3,0),0)=A$6,
    COLUMN($A$1:$D$3)-COLUMN($A$1)+1),ROWS(A$7:A7)),"")


Thank you, sir! That works perfectly!
 
Upvote 0

Forum statistics

Threads
1,214,825
Messages
6,121,788
Members
449,049
Latest member
greyangel23

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