# Match The Switch & Grab The Value From A Range

#### hsandeep

##### Well-known Member
My Data Range is B2:G9 (contains values) with ‘headers’ in B1:G1 (Non -numeric)

‘switches’ are in B12:G12 which are EITHER 0 OR 1; AND at a time ONLY 1 ‘SWITCH‘ FOR ‘UNIQUE’ HEADER WILL HAVE 0 OR 1

MATCHING SWITCH’ is in I1:L1

Output is required in I2:J9 as:
MATCH THE SWITCH & ‘grab’ the value from B2:G9

How to accomplish?
I am using Excel 2007.
Sheet1

 B C D E F G H I J 1 H L H L H L H L 2 50 60 70 80 88 99 70 60 3 4 5 6 7 8 9 1 2 5 8 9 1 5 2 10 11 12 0 1 1 0 0 0

<colgroup><col style="FONT-WEIGHT: bold; WIDTH: 30px"><col style="WIDTH: 40px"><col style="WIDTH: 40px"><col style="WIDTH: 40px"><col style="WIDTH: 40px"><col style="WIDTH: 40px"><col style="WIDTH: 40px"><col style="WIDTH: 12px"><col style="WIDTH: 40px"><col style="WIDTH: 40px"></colgroup><tbody>
</tbody>

### Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

#### hsandeep

##### Well-known Member
Match Unique Headers with switch value equal to 1 and grab the corresponding value

#### hsandeep

##### Well-known Member
I am using
=IFERROR(INDEX(\$B2:\$G2,MATCH(\$I\$1&1,\$B\$1:\$G\$1&\$B\$12:\$G\$12,0)),"")

BUT this does not differentiate between H & h.
Can anyone make the formula to 'rely' on EXACT MATCH?

#### Fluff

##### MrExcel MVP, Moderator
Cross posted

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.

Replies
1
Views
177
Replies
4
Views
249
Replies
6
Views
385
Replies
11
Views
756
Replies
3
Views
137

1,141,773
Messages
5,708,453
Members
421,570
Latest member
BaileyJ

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

### Which adblocker are you using?

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

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