how to change the numbers in a vlookup

bigdan

Well-known Member
Joined
Oct 5, 2009
Messages
846
Office Version
  1. 2013
Platform
  1. Windows
I have a vlookup in col B, that looks at the 2nd column in the source data (ie Jan). That works fine.
But I'd like to drag this vlookup to the right so that it looks at the relevant columns. At the moment if I drag my vlookup to the right it'll keep looking at the 2nd column. I'd like the vlookup to automatically change the numbers so that when I drag it to the right, it'll look at the relevant column. Is there a way to fix that?
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Something along the lines of
=VLOOKUP($L1,$A$2:$J$29,COLUMNS($A2:B2),0)
 
Upvote 0
Use the COLUMN() function to retrieve a number equal to the column where the formula is. You can do addition or subtraction from that number.

For example, your vlookup formula is in column 4 and you are reading column 6 in your data table. Instead of entering "6" in the vlookup function, change it to "COLUMN()+2". When you use the fill handle or copy the formula to column 5, it will lookup the data from column 7 in your data table, etc.
 
Upvote 0

Forum statistics

Threads
1,224,745
Messages
6,180,699
Members
452,994
Latest member
Janick

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