+ Reply to Thread
Results 1 to 6 of 6

Vlookup of string within a longer string

  1. #1
    Registered User
    Join Date
    10-28-2007
    Posts
    4

    Vlookup of string within a longer string

    Hi,

    Here is the format of the Data i have in a excel workbook:

    Sheet1 has 1 Column with data in this format
    Column1 Column2 (my desired output based on value in Sheet2)
    FTS-123-1 P1
    FTS-345-2 P3
    .
    .

    Sheet2 has two columns. Each cell of column1 here can have multiple values of the kind in sheet1:column1 space separated (FTS-123-1 FTS-6789-4).
    Column1 Column2
    FTS-123-1 FTS-6789-4 P1
    FTS-256-8 P2
    FTS-345-2 FTS-789-6 P3


    what i need to do here is: in sheet1:column2 i want to show the value from sheet2:column2 IF if a corresponding value in sheet2:column1 matches with the sheet1:column1 value.

    would appreciate any help on this. i hope my question is clear ...

    thanks,

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe


    =VLOOKUP("*"&A1&"*",Sheet2!A:B,2,FALSE)
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    10-28-2007
    Posts
    4
    Thanks much. That works. I need a modfication to this as well.

    If the two sheets are in separate workbooks how can I accomplish the same task?

    thanks,

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe something like

    =VLOOKUP("*"&A1&"*",[Book1.xls]Sheet1!$A:$B,2,FALSE)
    VBA Noob

  5. #5
    Registered User
    Join Date
    10-28-2007
    Posts
    4
    Thanks Again. That worked.

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Glad it helped

    VBA Noob

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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