# Advanced INDEX / VLOOKUP / MATCH (??) With row, column AND binary table

#### MistaMista

##### New Member
Hello!
I have a hard time finding the solution to this problem. I am not allowed to make any changes in the structure / format in sheet. Keep in mind, the two tables is in two different sheets (extremely simplified version, but formula is to be in Sheet 1, Column DISTRIBUTOR A1:A214)

SHEET 1: Bottleshop
 DISTRIBUTOR​ CITY​ ???? formula to match the City name -> with binary table in sheet 2 New York London London Berlin Ipswich Berlin .. goes all the way down. to A214, in total there is 20 different cities, and only 6 different distributors.

So I ran Solver, and based on minimizing objective cell, and we are now left with a BINARY table with the 20 different cities in ROW B2:U2, and the six different distributors in column A3:A6
See below for example. Each city are only provided by one distributor. Each city can have multiple bottleshops, but they will be provided by the same. Hence 214 shops, 20 cities, 6 distributors.

Sheet 2: DISTRIBUTOR
 Berlin​ Ipswich​ London (keeps going to U2 with 20 unique cities.) Max 0 1 0 Oscar 0 0 1 Popeye 1 0 0 Champis 0 0 0 North 0 0 0

So, my brain is cooking. How do i find where City in sheet one, matches city in Sheet two, but is equal to 1, so the return value is the distributor in column A?
I've tried index, match, ifs, or, but i can't figure this one out. I have Microsoft 2019, XLOOKUP or XMATCH doesnt work. Only Lookup, Vlookup, Hlookup, INDEX, MATCH.

For example, in sheet one, A5 Would be Popeye, because the binary table shows 1 under Berlin - Popeye

### Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Excel Formula:
``=INDEX(Sheet2!A3:A100,MATCH(1,INDEX(Sheet2!B3:U100,0,MATCH(B2,Sheet2!B2:U2,0)),0))``

Thank you so much, it worked!

You're welcome & thanks for the feedback.

Replies
1
Views
465
Replies
0
Views
343
Replies
1
Views
199
Replies
1
Views
294
Replies
4
Views
113

1,203,515
Messages
6,055,854
Members
444,828
Latest member
StaffordStag

### 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?

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