More sophisticated VLOOKUP

SunKing951

New Member
Joined
Jul 8, 2011
Messages
11
Good evening!

Does anyone know how to do a VLOOKUP formula which, instead of searching for an exact match, instead looks for only a certain amount of the first characters of the searched field to match, perhaps the first 10 for example?

Please let me know if I'm not being clear.

Thanks
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Taking a standard vlookup as example...
=VLOOKUP(A1,B:C,2,FALSE)

To make it look for A1 in Column B.
If A1 = Jon, then
Column B could be Jon******
If A1 = Hello, then
Column B could be Hello*****

=INDEX(C:C,MATCH(A1&"*",B:B,0))


Hope that helps.
 
Upvote 0
Taking a standard vlookup as example...
=VLOOKUP(A1,B:C,2,FALSE)

To make it look for A1 in Column B.
If A1 = Jon, then
Column B could be Jon******
If A1 = Hello, then
Column B could be Hello*****

=INDEX(C:C,MATCH(A1&"*",B:B,0))


Hope that helps.

Thanks. How would it work though if it weren't just a case of A1 being a shorter version and column B being that shorter version + undefined other characters? For example, what if A1 was sometimes "Jonathan", sometimes "Jonath21", or "Jonafun" etc.? In that case I'd want to make the formula reference only the first 4 characters of A1, and then only the first four of column B also. Any ideas?

Cheers
 
Upvote 0
Thanks. How would it work though if it weren't just a case of A1 being a shorter version and column B being that shorter version + undefined other characters? For example, what if A1 was sometimes "Jonathan", sometimes "Jonath21", or "Jonafun" etc.? In that case I'd want to make the formula reference only the first 4 characters of A1, and then only the first four of column B also. Any ideas?

Cheers

Good evening!

Does anyone know how to do a VLOOKUP formula which, instead of searching for an exact match, instead looks for only a certain amount of the first characters of the searched field to match, perhaps the first 10 for example?

Please let me know if I'm not being clear.

Thanks

Have a look also at:

http://www.mrexcel.com/forum/showthread.php?t=195635

You might want to consider providing sample data with the expected results though.
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,285
Members
452,902
Latest member
Knuddeluff

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