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

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
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
Personnel Type

<tbody>
</tbody>
B
Personnel ID

<tbody>
</tbody>
3
Type

<tbody>
</tbody>
B
Output

<tbody>
</tbody>
FORMULA HERE
Type

<tbody>
</tbody>
AB
ID#

<tbody>
</tbody>
1234512
Type + ID#

<tbody>
</tbody>
A1A2A3A4A5B1B2
Transaction Ref

<tbody>
</tbody>
A
B
C
D

<tbody>
</tbody>


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,213,506
Messages
6,114,024
Members
448,543
Latest member
MartinLarkin

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