INDEX MATCH MATCH based on 2 dynamic columns

Toxic9

New Member
Joined
Apr 4, 2018
Messages
5
I'm setting up a spreadsheet to process exports from an online survey tool. For the purpose of this post assume the column headings I need always have the same name and are always in Sheet 1. However, their column locations in each export can vary. For simplicity here are two examples:

Export 1
[TABLE="class: grid, width: 150"]
<tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]ID[/TD]
[TD]Q1[/TD]
[TD]Q1a[/TD]
[TD]Q2[/TD]
[TD]Q3[/TD]
[TD]EMAIL[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1[/TD]
[TD]Yes[/TD]
[TD]4[/TD]
[TD]No[/TD]
[TD]Yes[/TD]
[TD]bob@notreal.com[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]2[/TD]
[TD]Yes[/TD]
[TD]7[/TD]
[TD]Yes[/TD]
[TD]No[/TD]
[TD]jane@notreal.com[/TD]
[/TR]
</tbody>[/TABLE]

Export 2
[TABLE="class: grid, width: 150"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]ID[/TD]
[TD]Q1[/TD]
[TD]Q2[/TD]
[TD]EMAIL[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1[/TD]
[TD]No[/TD]
[TD]Yes[/TD]
[TD]jane@notreal.com[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]2[/TD]
[TD]Yes[/TD]
[TD]Yes[/TD]
[TD]bob@notreal.com[/TD]
[/TR]
</tbody>[/TABLE]


I need a formula that will work in both scenarios to populate this table:
[TABLE="class: grid, width: 150"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]EMAIL[/TD]
[TD]Q2[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]bob@notreal.com[/TD]
[TD]Formula here[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]jane@notral.com[/TD]
[TD]Formula here[/TD]
[/TR]
</tbody>[/TABLE]

I've got as far as the following, but know the highlighted part is the problem.

{=INDEX('Sheet 1'!$1:$1048576, MATCH(A2,MATCH("EMAIL",'Sheet 1'!$1:$1,0),0), MATCH("Q2",'Sheet 1'!$1:$1,0))}

Any help would be much appreciated - Thanks.
 

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

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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