Vlookup in between two numbers

kumatae

New Member
Joined
Feb 24, 2014
Messages
22
I don't think Vlookup is going to be my solution but it's close to what I want it to do. In Sheet 1, I have a list of ID numbers with blank columns of CITY.
In Sheet 2, I have a list of ranges of ID Numbers that is associated with a city.
I need a formula or VBA code that will go through each of the ID numbers in Sheet 1 against the ranges in Sheet 2 and return the city associated in Sheet 2 to Sheet 1.

I'm very familiar with Vlookup and have used it extensively but don't feel like it is going to work here. I'm thinking perhaps VBA but hoping for a simple formula. Thank you!

Sheet 1
ID_NUMBERCITY
5
15
29
31
44
58

Sheet 2
CITYBEGIN_ID_NUMBEREND_ID_NUMBER
LOS110
SEA1120
LAS2130
POR3140
DAL4150
SFO5160
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
How about
Excel Formula:
=INDEX(Sheet2!A2:A100,MATCH(A2,Sheet2!B2:B100,1))
 
Upvote 0
How about
Excel Formula:
=INDEX(Sheet2!A2:A100,MATCH(A2,Sheet2!B2:B100,1))
Thank you so much! My original Sheet 2 has ID numbers that vary and were all out of sort so it gave me results that weren't accurate but when I sorted, it worked perfectly! Thank you once again!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,918
Members
449,093
Latest member
dbomb1414

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