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