VLOOKUP is not returning required value because column index number changes

Sean15

Well-known Member
Joined
Jun 25, 2005
Messages
719
Office Version
  1. 2010
Platform
  1. Windows
Hello:

I am using VLOOKUP to pull data from worksheet A into worksheet B. Sometimes the column index number in worksheet A charges because columns are added or deleted and when this happens, Excel is returning the wrong value unless I update the VLOOKUP formula in worksheet B. Is there a formula I can use in worksheet B to pull required data no matter what the column index number in worksheet A?

Sean
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
If you have column headers you could use the MATCH function to find the column.
Excel Workbook
ABCDEF
1IDData1Data2Data3
2ID-11235
3ID-2456
4ID-3789
5ID-4101112
Sheet
 
Upvote 0
AhoyNC

Just tested your formula.

Thank you very much.

Regards,

Sean
 
Upvote 0
You can also try using INDEX/MATCH instead of VLOOKUP

=INDEX(C$2:C$5,MATCH("ID-2",$A$2:$A$5,0))

Now when a column is inserted/deleted, the C$2:C$5 reference will update automatically.
 
Upvote 0
Thank you very much Jonmo1

Regards,

Sean
 
Upvote 0

Forum statistics

Threads
1,223,234
Messages
6,170,891
Members
452,366
Latest member
TePunaBloke

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