ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   VLOOKUP on changing table!!HELP!!lol (https://www.excelbanter.com/excel-discussion-misc-queries/98606-vlookup-changing-table-help-lol.html)

mozza820

VLOOKUP on changing table!!HELP!!lol
 

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.


--
mozza820
------------------------------------------------------------------------
mozza820's Profile: http://www.excelforum.com/member.php...o&userid=36226
View this thread: http://www.excelforum.com/showthread...hreadid=560154


mozza820

VLOOKUP on changing table!!HELP!!lol
 

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


--
mozza820
------------------------------------------------------------------------
mozza820's Profile: http://www.excelforum.com/member.php...o&userid=36226
View this thread: http://www.excelforum.com/showthread...hreadid=560154


blissworks

VLOOKUP on changing table!!HELP!!lol
 

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)


--
blissworks
------------------------------------------------------------------------
blissworks's Profile: http://www.excelforum.com/member.php...o&userid=36156
View this thread: http://www.excelforum.com/showthread...hreadid=560154



All times are GMT +1. The time now is 02:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com