Vlookup with the beginning of a cell

Lauren111111

New Member
Joined
May 1, 2020
Messages
24
Office Version
  1. 2013
Platform
  1. Windows
I’m trying to vlookup the beginning of a cell and return a value from a table on another sheet.
E.g Luton = 5:30
But I want it to return the same value if it says Luton 2, or Luton 5
I can get this to work, but when I add more destinations and hours it stops working and find random values from elsewhere in the table even though another destination is completely different e.g Milton Keynes?? Is there a limit on the amount of data I can lookup with a partial cell? help please?
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
wrap in LEFT(,5), though vlookup will only return the first correct match
 
Upvote 0
How would I do this?? So far I have
=vlookup(c3&”*”,Sheet2!$B$3:$C$9,2,true)
Where c3 = Luton, and the data range is the destinations and timings
 
Upvote 0
Try using
VBA Code:
=vlookup(left(c3,5),Sheet2!$B$3:$C$9,2,true)
But as @mole999 said, it will only return the first correct entry
 
Upvote 0
Thanks, have given it a try but doesn’t work as id like. Is there any other way I could get this to work?
 
Upvote 0
you might need to post some sample data, with the result you expect.....use the XL2BB button to paste data back here
 
Upvote 0
if the numbers are superflous then they could be substituted out
 
Upvote 0
If anyone has the same query, we managed to fix it - the lookup data range needed to be in alphabetical order then it worked! This is why it wouldnt lookup past certain values. Thanks for advice everyone.
 
Upvote 0
If anyone has the same query, we managed to fix it - the lookup data range needed to be in alphabetical order then it worked! This is why it wouldnt lookup past certain values. Thanks for advice everyone.
that should mean that the list selection was not long enough, and need to use 1 for inexact match and 0 for exact match. Vlookup returns the FIRST entry only from the listed values
 
Upvote 0

Forum statistics

Threads
1,213,538
Messages
6,114,218
Members
448,554
Latest member
Gleisner2

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