Column Index Number Variations

trainer75

New Member
Joined
Jun 11, 2015
Messages
33
Hi,
I have this formula
=IF(ISNA(VLOOKUP($A10,INDIRECT($P1&"!A:j"),4,0)=TRUE),0,VLOOKUP($A10,INDIRECT($P1&"!A:j"),4,0))
but I would like to have the column index number variable, so that when I change a look up it will go to another column.
I have data in columns 4 through to 10 and would like to select it by column.

is this something that can be done?

Regards,
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
In a remote/empty cell, say Cell M1 enter your 4 variable (or any other column # between 4 and 10)

Change your Formula to:
Code:
=IF(ISNA(VLOOKUP($A10,INDIRECT($P1&"!A:j"),$M$1,0)=TRUE),0,VLOOKUP($A10,INDIRECT($P1&"!A:j"),$M$1,0))
 
Upvote 0
In a remote/empty cell, say Cell M1 enter your 4 variable (or any other column # between 4 and 10)

Change your Formula to:
Code:
=IF(ISNA(VLOOKUP($A10,INDIRECT($P1&"!A:j"),$M$1,0)=TRUE),0,VLOOKUP($A10,INDIRECT($P1&"!A:j"),$M$1,0))


hi there,

thank you for replying,
the 4 variables are columns I would like the look up to search for.
so for example column 4 is box, column 5 is crate, column 6 is trolley, I would like to choose them on a drop down box as there is info in all columns but I want it separate.
What would I enter into "M1" for it to be variable?

Regards,
 
Upvote 0
Maybe something like this....


Excel 2012
ABCDEFGHIJKLMN
1Enter Either Box, Crate or Trolley in K1 >>Box4
2
3Box4
4Crate5
5Trolley6
Sheet1
Cell Formulas
RangeFormula
M1=VLOOKUP($K$1,$M$3:$N$5,2,0)
 
Upvote 0
hi there,

thank you for replying,
the 4 variables are columns I would like the look up to search for.
so for example column 4 is box, column 5 is crate, column 6 is trolley, I would like to choose them on a drop down box as there is info in all columns but I want it separate.
What would I enter into "M1" for it to be variable?

Regards,

Or this :

=IF(ISNA(VLOOKUP($A10,INDIRECT($P1&"!A:j"),MATCH($M$1,{"box";"crate";"trolley"},0)+3,0)=TRUE),0,VLOOKUP($A10,INDIRECT($P1&"!A:j"),MATCH($M$1,{"box";"crate";"trolley"},0)+3,0))
 
Upvote 0
Maybe something like this....


Excel 2012
ABCDEFGHIJKLMN
1Enter Either Box, Crate or Trolley in K1 >>Box4
2
3Box4
4Crate5
5Trolley6
Sheet1
Cell Formulas
RangeFormula
M1=VLOOKUP($K$1,$M$3:$N$5,2,0)


That worked brilliantly,
Thank you very much for your assistance, been wracking my brains for 2 days trying to find the link in the formula.
Much appreciated.

Kind Regards
 
Upvote 0

Forum statistics

Threads
1,215,883
Messages
6,127,544
Members
449,385
Latest member
KMGLarson

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