Can INDEX functions be Variable?

dangerousmouse

New Member
Joined
Jan 8, 2010
Messages
9
Hi,<o:p></o:p>
<o:p> </o:p>



<o:p>
Hi,<o:p></o:p>

<o:p> </o:p>

I’ve had many happy years enjoying VLOOKUP, but now I’vemoved on to a deeper relationship with INDEX MATCH ;o)<o:p></o:p>

<o:p> </o:p>

<o:p> </o:p>

I am using INDEX MATCH to return values from a table with 54columns.<o:p></o:p>

<o:p> </o:p>

There are 3 criteria to MATCH -<o:p></o:p>

MATCH expressions are variable – they are taken from dependentdrop down lists in cells C6, C12 and C9<o:p></o:p>

<o:p> </o:p>
An example of my inelegant but working formula is:<o:p></o:p>

=IF(C18="AgeLimit",INDEX(AgeLimit,MATCH(1,(Reseller=C6)*(Level=C12)*(PolicyType=C9),0)),IF(C18="HazardousActivities",INDEX(Hazardous1,MATCH(1,(Reseller=C6)*(Level=C12)*(PolicyType=C9),0)),IF(C18="Valuables",INDEX(Valuables1,MATCH(1,(Reseller=C6)*(Level=C12)*(PolicyType=C9),0)))))<o:p></o:p>


I would like to avoid using 54 nested IF Statements toindicate which column the INDEX function should return values from.<o:p></o:p>

<o:p> </o:p>
My questions are:<o:p></o:p>

Can the INDEX function be variable also?<o:p></o:p>

Can anyone show me how to combine INDEX MATCH with INDIRECTSUBSTITUTE to make the INDEX function variable?<o:p></o:p>

<o:p> </o:p>
Possible Solutions:<o:p></o:p>

[TABLE="class: MsoNormalTable, width: 469"]
<tbody>[TR]
[TD="width: 626, bgcolor: transparent"] I found this on another Mr Excel post – the closest solution I have found in my research.<o:p></o:p>
<o:p> </o:p>
To make INDEX function variable:<o:p></o:p>
INDEX(INDIRECT(R1),MATCH("Ralph",INDIRECT(R1&"[Name]"),0),MATCH("Sales",INDIRECT(R1&"[HEADERS]"),0))<o:p></o:p>
[/TD]
[/TR]
[TR]
[TD="width: 626, bgcolor: transparent"] <o:p> </o:p>
Also, to delete any spaces so formula can work with multi word entries in a drop down list.<o:p></o:p>
[/TD]
[/TR]
[TR]
[TD="width: 626, bgcolor: transparent"] INDIRECT(SUBSTITUTE($C$15," ",""))<o:p></o:p>
[/TD]
[/TR]
</tbody>[/TABLE]


Thanks so much,<o:p></o:p>

<o:p> </o:p>

Mike<o:p></o:p>

</o:p>


 
Hello Again,

I solved this by looking at each parenthesis and inserting an extra one alongside.
This eventually gave me the answer based on Aladin's awesome combo.

{=INDEX(INDIRECT(SUBSTITUTE($C$18," ","")),MATCH(1,(Reseller=C6)*(Level=C12)*(PolicyType=C9),0))}

Thank you Everyone for your Direction and Guidance!

Mike

You are welcome.
 
Upvote 0

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,223,275
Messages
6,171,122
Members
452,381
Latest member
Nova88

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