VLookup: automatic column changes

aallaman

New Member
Joined
Dec 4, 2009
Messages
44
Please Help!

I am working with a worksheet in which I have a vlookup function that needs to be drag and copied 120 columns across. At each change in column, I need the column index number, in the vlookup function, to increase by one.

=vlookup($a1,B:CD,1,false) =vlookup($a1,B:CD,2,false) =vlookup($a1,B:CD,3,false)

Does anyone know of a way to write the formula so that the col_index_num changes automatically when you copy it across columns?

Do I need to use {}? What are {} for?

Thanks!!!!!!1
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

jbeaucaire

Well-known Member
Joined
May 8, 2002
Messages
6,012
Use this in the first cell, then copy to the right:

=VLOOKUP($A1, $B:$CD, COLUMNS($A:A), FALSE)
 

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
Hello aalaman, you can use COLUMNS function in place of the column index so that it changes as you drag across but possibly better to use INDEX/MATCH, i.e. this formula copied across

=INDEX(B:B,MATCH($A1,$B:$B,0))

Note the MATCH function won't change as you drag across but the INDEX column will.....
 

de909

Board Regular
Joined
Mar 27, 2009
Messages
100
Here are a couple of options:

x3xshk.jpg
 

Forum statistics

Threads
1,144,628
Messages
5,725,378
Members
422,622
Latest member
Paranthem

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
Top