+ Reply to Thread
Results 1 to 12 of 12

Find a value in a long string array using VLOOKUP

  1. #1
    Registered User
    Join Date
    09-20-2017
    Location
    US
    MS-Off Ver
    2010
    Posts
    6

    Find a value in a long string array using VLOOKUP

    Hi, I have searched a lot and I am not able to find a solution for this. I am hoping you guys can help me


    I need to look for a Value (column A) in a String array (column B) and to return an adjacent Value (column C). This formula works for me when the the String array (column B) is kinda short.

    =VLOOKUP("*"&A1&"*",B:C,2,FALSE)

    But if the String array (column B) is huge I get a #N/A.


    I think there must be a limit for the "Concatenation". What do you guys think? Thanks!

  2. #2
    Forum Contributor
    Join Date
    01-05-2017
    Location
    New York
    MS-Off Ver
    Office 2016
    Posts
    206

    Re: Find a value in a long string array using VLOOKUP

    But if the String array (column B) is huge I get a #N/A.
    How huge? The limit for text strings inside a formula is 255 characters.

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Find a value in a long string array using VLOOKUP

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Registered User
    Join Date
    09-20-2017
    Location
    US
    MS-Off Ver
    2010
    Posts
    6

    Re: Find a value in a long string array using VLOOKUP

    Quote Originally Posted by Raphaelp View Post
    How huge? The limit for text strings inside a formula is 255 characters.
    Thanks Raphaelp, most of the Strings in my file have around 1,700 characters (including spaces). Is there a way to ignore the 255 char limit?

    I have attached an example as Glenn advised; As you can see one VLOOKUP is working and the other one is not due to the size of the String.
    Attached Files Attached Files

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Find a value in a long string array using VLOOKUP

    I don't think that you have provided enough information yet... Two rows where A1 is included within B1 may not reflect reality..


    But... try this in F2, copied down:

    =IF(ISNUMBER(SEARCH(A2,B2)),OFFSET(A2,,2,,))

  6. #6
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Find a value in a long string array using VLOOKUP

    This seems to work, as an array formula:
    =INDEX($C$2:$C$3,MAX(ROW($1:$2)*NOT(ISERROR(FIND(A2,$B$2:$B$3)))))
    Pauley
    --------
    If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).

  7. #7
    Registered User
    Join Date
    09-20-2017
    Location
    US
    MS-Off Ver
    2010
    Posts
    6

    Re: Find a value in a long string array using VLOOKUP

    Quote Originally Posted by Glenn Kennedy View Post
    I don't think that you have provided enough information yet... Two rows where A1 is included within B1 may not reflect reality..


    But... try this in F2, copied down:

    =IF(ISNUMBER(SEARCH(A2,B2)),OFFSET(A2,,2,,))
    You are right Glenn, A1 could be anywhere in column B. Your Formula works if both Values are on the same row. Sorry for lack of info, I didn't want to bother you guys with a huge file.

  8. #8
    Registered User
    Join Date
    09-20-2017
    Location
    US
    MS-Off Ver
    2010
    Posts
    6

    Re: Find a value in a long string array using VLOOKUP

    Quote Originally Posted by Pauleyb View Post
    This seems to work, as an array formula:
    =INDEX($C$2:$C$3,MAX(ROW($1:$2)*NOT(ISERROR(FIND(A2,$B$2:$B$3)))))
    Thanks Pauley, this seems to return C1 if A1 was found anywhere in B. I would need (for example) C99 if A1 was found on B99.

  9. #9
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,899

    Re: Find a value in a long string array using VLOOKUP

    Or try:

    =LOOKUP(2,1/FIND(A2,$B$2:$B$10),$C$2:$C$10)

  10. #10
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Find a value in a long string array using VLOOKUP

    Quote Originally Posted by RequiredField View Post
    Thanks Pauley, this seems to return C1 if A1 was found anywhere in B. I would need (for example) C99 if A1 was found on B99.
    Hmm, thought I tested for that. Did you enter it as an array formula (Ctrl Shift Enter)? @Phuocam's solution may be better since it is not an array formula.
    Last edited by Pauleyb; 09-21-2017 at 10:41 AM.

  11. #11
    Registered User
    Join Date
    09-20-2017
    Location
    US
    MS-Off Ver
    2010
    Posts
    6

    Re: Find a value in a long string array using VLOOKUP

    Quote Originally Posted by Pauleyb View Post
    Hmm, thought I tested for that. Did you enter it as an array formula (Ctrl Shift Enter)? @Phuocam's solution may be better since it is not an array formula.
    To be honest I didn't know I had to hit ctrl+shift+enter it worked, thanks!

  12. #12
    Registered User
    Join Date
    09-20-2017
    Location
    US
    MS-Off Ver
    2010
    Posts
    6

    Re: Find a value in a long string array using VLOOKUP

    Quote Originally Posted by Phuocam View Post
    Or try:

    =LOOKUP(2,1/FIND(A2,$B$2:$B$10),$C$2:$C$10)
    This also worked and looks simple, thanks Phuocam!

+ 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. Replies: 4
    Last Post: 04-25-2017, 11:01 AM
  2. [SOLVED] Vlookup using part of long text string
    By chippy502 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-20-2016, 09:48 AM
  3. excel formula to find after every 2nd underscore value from long string.
    By breadwinner in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-05-2015, 07:12 AM
  4. VBA Find Partial String in String Array and Output the Found String Array Value
    By scherich in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-02-2014, 11:20 AM
  5. [SOLVED] Vlookup, Match (Search or Find) partial string within string in a Cell
    By dluhut in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-28-2013, 12:40 PM
  6. [SOLVED] Find array value within a string
    By AULZ in forum Excel General
    Replies: 4
    Last Post: 09-07-2012, 07:39 AM
  7. Replies: 8
    Last Post: 08-07-2012, 10:15 AM

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