Vlookup restricted to 255 String Search ?

SamBo1234

Board Regular
Joined
Aug 21, 2006
Messages
77
Hi all,

Been working with some rather lengthy data, and have just finally after about 2 hours of nearly pulling my hair out realised that VLOOKUP only works with strings = to or less than 255 Characters.

Is there anyway around this problem?

I have strings, approximatley 600+ in some cases and would rather not split the strings up so i can perform a simple VLOOKUP function.

Any help is appreciated. TY all.
 
Hi hatman,

first thank you for your help. It works, but there is one problem.

Here an example:
I'm searching for string "xxx"

Row | Text | Return
1 | xxx faskjdnkkal | Grey
2 | jflkjlkead | Yellow
3 | jlkads xxx faklsdj | blue

When I use your formel I only get "blue" back. Do you know, how I can say Excel, that he should take the first match.

Thanks a lot!
 
Upvote 0

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
I built the formula assuming that there would only be a single match. If you have more than one, then I expect it to return the last match in the table. If you want the first match, the change would be:
Code:
=INDEX(C:C,min(IF(ISNUMBER(SEARCH(B9,B2:B4)),ROW(B2:B4),9E10)))

If you want the Nth match from the table, where N is contained in cell A1, then use the following:
Code:
=INDEX(C:C,small(IF(ISNUMBER(SEARCH(B9,B2:B4)),ROW(B2:B4),9e10),a1))
Which will generate an error if you specify N greater than the total number of matches...
 
Upvote 0

Forum statistics

Threads
1,215,580
Messages
6,125,654
Members
449,245
Latest member
PatrickL

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