+ Reply to Thread
Results 1 to 5 of 5

Vlookup Via Searching Text in Cell -Char limit?

  1. #1
    Registered User
    Join Date
    03-20-2020
    Location
    Maywood, USA
    MS-Off Ver
    2016 & 365
    Posts
    13

    Vlookup Via Searching Text in Cell -Char limit?

    Backstory:
    I am attempting to find a solution that looks for specific model numbers in a cell with multiple model numbers in one cell. Then I wanted to do a sort of vlookup.

    My thought was to do a
    =vlookup("*"&"[text here]"&"*",[range],[column#/match],FALSE)


    Issue:
    It does seem to work but not consistently. I attempted to add a large number of characters into a reference cell and the formula no longer works. I am suspecting that there is a character limit to how far excel will search a cell.

    I was wondering if there was an alternative around this or some other formula that I haven't thought of. The issue is how to recognize text in a table that has thousands of rows since it will be about 70% buried in text in a cell vs. being the only text in the cell. example CG501CG502CG503CG504...CG560 vs CG504.


    Please refer to the document attached. Thank you everyone for your assistance.
    Attached Files Attached Files

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.97.2 for Mac MS 365
    Posts
    8,708

    Re: Vlookup Via Searching Text in Cell -Char limit?

    got it to work when I changed the range to this... =VLOOKUP("*"&$I$3&"*",$A$2:$E$8,5,FALSE)
    see attached.
    Attached Files Attached Files
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Registered User
    Join Date
    03-20-2020
    Location
    Maywood, USA
    MS-Off Ver
    2016 & 365
    Posts
    13

    Re: Vlookup Via Searching Text in Cell -Char limit?

    Dear Sam,

    After taking a look at your workbook, it appears that I found the issue. Unfortunately, it doesn't really solve the problem in all scenarios.

    Please refer to my document. After running some tests, it appears that Excel limits looking at cells beyond 255 character count.

    The process started when yours worked but mine did not. Using "=len([cell])", I found yours had fewer characters than mine. Sam's was 220 characters while mine had 263. Visually put side to side in unwrapped text mode, they looked the same. Quickly figured there were paragraph indentations, so I used:

    "=SUBSTITUTE([Cell],"
    ","")

    which lead to the same character count of 220. This furthered my hypothesis that this was a character limit issue. So, I ran another test. I attempted to put enter characters until the formula would not work. Logically, it would be between 220 and 263. I also shortened it by testing in multiples of 5. That is where I discovered the formula stopped working beyond 255. Adding one extra character [256] would break the formula (see tab SAMPLE V2).

    After testing to see if excel only looks at the first 255 or just skips these cells, I have come to the conclusion, excel won't search any cell that is beyond 255 characters in length.

    I was wondering if there was any other solution or if this is just a limitation of excel. Any alternative solution would be greatly appreciated.


    Thanks.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    03-20-2020
    Location
    Maywood, USA
    MS-Off Ver
    2016 & 365
    Posts
    13

    Re: Vlookup Via Searching Text in Cell -Char limit?

    I should have also mentioned that my organization limits developer mode functions, so the 255 character would be difficult to overcome.

  5. #5
    Registered User
    Join Date
    03-01-2022
    Location
    Eire
    MS-Off Ver
    O365 Beta
    Posts
    89

    Re: Vlookup Via Searching Text in Cell -Char limit?

    I'm not sure what your expected result is... try:

    =TRANSPOSE(INDEX(E:E,IF(ISNUMBER(SEARCH($J$10,Table145[FIELD])),ROW(Table145[FIELD]),""))) in K10.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Separate string of text, based on dynamic 3-char, 4-char and spaces, into columns
    By Christopher135 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-24-2023, 07:03 PM
  2. [SOLVED] Is length of text string after nth (but before nth) delimiter over certain char limit?
    By The Molecular Level in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-29-2019, 01:50 PM
  3. [SOLVED] Vlookup - Searching for text within a cell
    By bradro in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-04-2017, 05:08 PM
  4. Any way around the 255 char string limit?
    By scottc_00 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-15-2016, 10:18 AM
  5. Replies: 12
    Last Post: 04-08-2014, 08:12 PM
  6. [SOLVED] Searching for Cell Content Larger than Find Function's Character Limit
    By spira in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-20-2012, 08:59 PM
  7. LIMIT NUMBER OF CHAR IN A COMBINE CELL
    By rafaeljsg in forum Excel General
    Replies: 1
    Last Post: 10-05-2005, 12:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1