Index function with variable range reference

dmcgoo

New Member
Joined
Dec 1, 2003
Messages
46
Hi Guys

I have a sheet with data as shown in columns A:"H below. I also currently have a function as shown = index($d8:h11,match(b3,$b8:4B11,0)match($b2,D7:h7,0).
I now want to add in other Type Options B through D. How can I change the array $d8:$h11 so that it is based on whatever is selected in cell b4?

Many thanks

dmcgoo

Book1
ABCDEFGHIJKLMNOPQRSTUVW
1
2Personnel TypeB
3Personnel ID3
4TypeB
5
6TypeABCD
7ID#12345123451234512345
8Transaction RefAXXXXXXXXXXXXXXXXXXXX
9BXXXXXXXXXXXXXXXXXXXX
10CXXXXXXXXXXXXXXXXXXXX
11DXXXXXXXXXXXXXXXXXXXX
Sheet1
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Could you merge rows 6 and 7 together (will have to use the offset function) and base the index match off the merged rows?
 
Upvote 0
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][TABLE="width: 101"]
<tbody>[TR]
[TD="width: 101"]Personnel Type[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]B
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][TABLE="width: 101"]
<tbody>[TR]
[TD="width: 101"]Personnel ID[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][TABLE="width: 101"]
<tbody>[TR]
[TD="width: 101"]Type[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]B[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][TABLE="width: 101"]
<tbody>[TR]
[TD="width: 101"]Output[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]FORMULA HERE[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][TABLE="width: 101"]
<tbody>[TR]
[TD="width: 101"]Type[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD]A[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]B[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][TABLE="width: 101"]
<tbody>[TR]
[TD="width: 101"]ID#[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]1[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD][TABLE="width: 101"]
<tbody>[TR]
[TD="width: 101"]Type + ID#[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD]A1[/TD]
[TD]A2[/TD]
[TD]A3[/TD]
[TD]A4[/TD]
[TD]A5[/TD]
[TD]B1[/TD]
[TD]B2[/TD]
[/TR]
[TR]
[TD][TABLE="width: 101"]
<tbody>[TR]
[TD="width: 101"]Transaction Ref[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]A[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]B[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]C[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]D[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


For formula to go in cells C7 onwards is =OFFSET(D5,,-D6+1)&D6.
Formula to go in cell B4 is =INDEX($D$8:$W$11,MATCH($B$1,$B$8:$B$11,0),MATCH($B$3&$B$2,D7:W7,0)).

Hope this helps.
 
Upvote 0

Forum statistics

Threads
1,224,829
Messages
6,181,222
Members
453,024
Latest member
Wingit77

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