+ Reply to Thread
Results 1 to 4 of 4

vlookup

  1. #1
    Forum Contributor
    Join Date
    05-03-2004
    Location
    England
    MS-Off Ver
    2003 Excel
    Posts
    118

    vlookup

    Hi all,
    I am using vlookup to turn an imported 4 letter / digit code into detail.

    I am hoping someone can help me shorten the process.

    The data comes in as say

    ----col A
    ----AA21
    ----BB22
    ----AA22

    The first 2 letters signify one detail and the second two signify another

    Elsewhere I have a data sheet that gives me detail
    i.e
    ---col L-----col M----col N----col O
    ----AA-------car-------21-----small
    ----BB------truck-----22------large

    At present I text to columns splitting the AA21 into to extra columns giving me
    ---col B-----col C
    ----AA--------21

    I then insert another column after column B.
    In this column I then vlookup in col L & M the value in col B(AA) to return car.

    I then insert another column after column D.
    In this column I then vlookup in col N & O the value in col C (21) to return car.

    Then I insert another column and join them together using =*&* to give me what I am looking for

    car small
    truck large
    car large

    The data that is imported has many different combinations.

    This process works fine but I realise this is probably a long winded way of doing it which is why I am looking for a quicker way.

    Apologies if the description is confusing.

    Thank you in advance,

    Greg.

  2. #2
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    I named the range with AA, BB as 'type' and the range with 21, 22, etc. as 'size'. with that done, try this formula:

    =VLOOKUP(LEFT(A1,2),type,2)&" "&VLOOKUP(1*RIGHT(A1,2),size,2)

    per your sample data:

    AA21 = car small
    BB22 = truck large
    AA22 = car large


    HTH

    Bruce
    Bruce
    The older I get, the better I used to be.
    USA

  3. #3
    Forum Contributor
    Join Date
    05-03-2004
    Location
    England
    MS-Off Ver
    2003 Excel
    Posts
    118
    Perfect Bruce,

    thanks,

    Greg.

  4. #4
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    Greg: You are most welcome. I'm glad it worked for you. Thanks for the feedback, it is always appreciated.

    Cheers!

    Bruce

+ 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