# Thread: MATCH & INDEX (what am I missing)

1. ## MATCH & INDEX (what am I missing)

This is going to be complicated to explain but I'll try my best. I've attached my project to help you understand.

I have three sheets TAKEOFF, PCFB & PCFB1.

In cell G6, I have this formula: =INDEX(PCFG!\$U\$6:\$AA\$37,MATCH(C6,PCFG!\$U\$6:\$U\$37,0),MATCH(D6,PCFG!\$U\$6:\$AA\$6,0)) in cell G6 of the TAKEOFF sheet.

I'm using this formula to return the intersecting cell on the PCFG sheet base on what I have in cell C6 & D6 of the TAKEOFF sheet.

In its current state, I have "PCFG" (a sheet name) baked into the formula. I need that part to be dynamic, based on which sheet name I put in cell B6.

The formula currently doesn't use cell B6, but I need to be able to specify a sheet name "PCFG" or "PCFG1" in B6 and have the rest of the formula pull the data from that sheet.

Can this be done?  Reply With Quote

2. This could be done by using the INDIRECT function.
But this will make formulas cumbersome and eventually slow calculations down as INDIRECT is a volatile function

As the only difference between PCFG sheets is the discount percentage why not use L6:R37 form PCFG sheet as base prize and enter the discount in B6 ?
Adapt your formula with the necessary ranges and multiply it by B6  Reply With Quote

3. Originally Posted by airpuncher Can this be done?
See if you get this formula with the INDIRECT function solves the problem, such as a colleague @Pecoflyer suggested
Put this formula in G6
Code:
`=INDEX(INDIRECT("'"&\$B6&"'!"&CHAR(COLUMN(CG85))&ROW(\$U\$6)&":\$AA\$37"),MATCH(C6,INDIRECT("'"&\$B6&"'!"&CHAR(COLUMN(CG85))&ROW(\$U\$6)&":\$U\$37"),0),MATCH(D6,INDIRECT("'"&\$B6&"'!"&CHAR(COLUMN(CG85))&ROW(\$U\$6)&":\$AA\$6"),0))`  Reply With Quote

4. @navic
Thanks for quoting me, but I think the use of INDIRECT is not the most efficient technique in this case  Reply With Quote

5. Originally Posted by Pecoflyer This could be done by using the INDIRECT function.
But this will make formulas cumbersome and eventually slow calculations down as INDIRECT is a volatile function

As the only difference between PCFG sheets is the discount percentage why not use L6:R37 form PCFG sheet as base prize and enter the discount in B6 ?
Adapt your formula with the necessary ranges and multiply it by B6

Thanks, Pecoflyer. You're right, in the example, the percentage is the only difference between the PCFG sheets. This won't be the case once I flesh this thing out. Thanks for the suggestion though.

What do you mean by "INDIRECT is a volatile function"?  Reply With Quote

6. Thanks.  Reply With Quote

7. What do you mean by "INDIRECT is a volatile function"?
http://www.decisionmodels.com/calcsecretsi.htm  Reply With Quote

index, match, table extraction 