+ Reply to Thread
Results 1 to 6 of 6

Thread: VLOOKUP with contains function?

  1. #1
    Registered User
    Join Date
    02-22-2008
    Posts
    7

    VLOOKUP with contains function?

    Does anyone know if the following is possible?

    I have a column of data with fields that look like ABCD1234RTF or AB-CRT3456-PRT.

    I then have a table with the values 1234 and 3456 etc in it with corresponding other data.

    Is there a function I can use to search through my list of data looking within each field for just the number part and if found then return another column from my lookup table?

    I hope for 2 things:
    1) that what I have written actually makes sense to someone
    2) that someone knows how I can achieve the above result

    Thanks

  2. #2
    Forum Guru sweep's Avatar
    Join Date
    04-03-2007
    Location
    Location: Location:
    MS-Off Ver
    3.0
    Posts
    2,472
    Hi,

    You can extract just the numeric portion of your cell with this array formula

    =1*MID(A1,MATCH(TRUE,ISNUMBER(1*MID(A1,ROW($1:$9),1)),0),COUNT(1*MID(A1,ROW($1:$9),1)))

    enter it with CTRL, SHIFT and ENTER and excel should display it like this

    {=1*MID(A1,MATCH(TRUE,ISNUMBER(1*MID(A1,ROW($1:$9),1)),0),COUNT(1*MID(A1,ROW($1:$9),1)))}

    You can then use the number to do the lookup.
    Please disregard anything in the above post. It may well have been edited without my consent, as has been the case with several posts and threads recently.

  3. #3
    Forum Guru
    Join Date
    03-14-2006
    Location
    Pakistan
    Posts
    1,799

    Lightbulb

    You can try using lookup_value wraped with wildcard like this: *1234*

    Formula would be like this

    =VLOOKUP("*1234*",table_array,col_index,0)
    starguy

    Tahir Aziz
    PAKISTAN

    __________________
    Forum Rules (read before you post)
    Links to the world of Excel

  4. #4
    Registered User
    Join Date
    02-22-2008
    Posts
    7
    Hi,

    The formula you stated to pull out the numerical part is really good (though I have no idea how it works!). Unfortunately it does not work on all of my records. For example see the records below:

    Would it be possible to use a variation of the formula to pick out the 800903 from ABC9-D800903EFG-H?

    I need to pick out the 98355 from E8BG-98355X023
    I need to pick out the 98351 from F182-98351J789

    Thanks

  5. #5
    Forum Guru
    Join Date
    03-14-2006
    Location
    Pakistan
    Posts
    1,799

    Lightbulb

    Quote Originally Posted by DannyG
    Hi,

    The formula you stated to pull out the numerical part is really good (though I have no idea how it works!). Unfortunately it does not work on all of my records. For example see the records below:

    Would it be possible to use a variation of the formula to pick out the 800903 from ABC9-D800903EFG-H?

    I need to pick out the 98355 from E8BG-98355X023
    I need to pick out the 98351 from F182-98351J789

    Thanks
    Have you tried formula using wildcard?
    starguy

    Tahir Aziz
    PAKISTAN

    __________________
    Forum Rules (read before you post)
    Links to the world of Excel

  6. #6
    Registered User
    Join Date
    02-22-2008
    Posts
    7
    Hey,

    Yeah I did try this and it works really well. it does not do exactly as I need it too but I can work with it to achieve the desired effect!

    Thanks

+ 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.2.0