Autofill Column Index in Vlookup

Carin

Board Regular
Joined
Feb 4, 2006
Messages
224
I would like to autofill a vlookup. What I'm trying to get is the column index number to increase by 1.

Example:

B1
=VLOOKUP($A$1,'Anchorage AK'!$A$1:$W$26,4,FALSE)

C1
=VLOOKUP($A$1,'Anchorage AK'!$A$1:$W$26,5,FALSE)

D1
=VLOOKUP($A$1,'Anchorage AK'!$A$1:$W$26,6,FALSE)

When I drag the cell, the column index stays at 4.

Thanks
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
You can use INDEX and match instead:
in B1: =INDEX('Anchorage AK'!D$1:D$26,MATCH($A$1,'Anchorage AK'!$A$1:$A$26,0))
and copy across.
HTH
 
Upvote 0
You could also use a helper row.


Put 4 in Z1, 5 in Z2, and 6 in Z3

Vlookup($A$1,'Anchorage AK'!$A$1:$W$26,Z1,FALSE) and copy across.
 
Upvote 0
PS It would be even more efficient if you stored the MATCH part in one column and used it repeatedly:
B1: =MATCH($A$1,'Anchorage AK'!$A$1:$A$26,0)
C1: =INDEX('Anchorage AK'!D$1:D$26,$B1)
then copy C1 across as far as required. That way you only have to look A1 up once.
 
Upvote 0
I'm lost...did you make up cell references. I've never used Index before. It's telling me I have multiple arguments listed..???
 
Upvote 0
Nope, I used the references you gave. Which version of Excel?
Incidentally, to use VLOOKUP, you could use:
B1: =VLOOKUP($A$1,'Anchorage AK'!$A$1:$W$26,COLUMN()+2,FALSE)
and copy across.
 
Upvote 0
Try

=VLOOKUP($A$1,'Anchorage AK'!$A$1:$W$26,COLUMN()+2,FALSE)

Please note that this will go haywire if you subsequently add columns to the left of B.
 
Upvote 0
I like to embed a MATCH in the column index number if the items share the same header. I find it avoids headaches, especially if you have a HUGE spreadsheet you're dealing with.

something like this:
=VLOOKUP($A$2,'Anchorage AK'!$A$1:$W$26,MATCH(B$1,'Other Sheet'$B$1:$Z$1,0),FALSE)
 
Upvote 0

Forum statistics

Threads
1,220,725
Messages
6,155,612
Members
451,304
Latest member
vishalranaut

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