VLOOKUP on changing table!!HELP!!lol

M

mozza820

Hi guys,

Basically it is a simple problem but no one knows a simple solution. I
am using VLOOKUP to find values fronm a table with about 40 columns,
but sadly I am not in control of this table and the columns order can
change (ie A becomes C and D becomes B) but I dont want to re-write the
code evrytime the column changes. So basically I need a way of using
VLOOKUP but not entering the column number and entering the column name
so it searches for that. So for example, it will look for the column
entitled 'Username' and not just the '7th column in' for example, as in
a few mnths tim,e it will still be called 'Username' but may now be the
9th column in.

Any help is appreciated. Thanks.
 
M

mozza820

Basically I am ideally looking to replace the column index number in th
Vlookup with a column title? can this be done or does anyone know a wa
round this
 
B

blissworks

You can use column() function instead of hard coding column number. Just
use this function in Vlookup function. and also you shd subtract no.of
columns from first column to first column of your array.
=vlookup(b1,test!b1:bz100,column(test!d1)-1)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top