+ Reply to Thread
Results 1 to 3 of 3

Excel 2007 : VLOOKUP after Extracting

Hybrid View

  1. #1
    Forum Contributor SCLai's Avatar
    Join Date
    08-18-2010
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    129

    VLOOKUP after Extracting

    Sorry for the bad title... but this is basically what happened:

    ---- ---- A ---- ---- ---- B ---- ---- ---- C ---- ---- ---- D
    1 | 319R25201
    2 | 783RG1720
    3 | 319R25302
    4 | 320R0G037

    Basically, I would like to:

    - Extract the 1st 3 char from Column A (E.g 319 from 319R25201)

    - Compare it to a pre-defined table, E.g: Column F & G
    -- ---- ---- F ---- ---- ---- G ----
    1 | ---- --319 ---- ---- SP-01
    2 | ---- --320 ---- ---- SP-02
    3 | ---- --780 ---- ---- PA-12
    4 | ---- --783 ---- ---- PA-15

    - And return the value of Column G into column B

    I have tried =VLOOKUP(LEFT(A1,3),F1:G4,2,0), but it returned #NA.
    If i input 319 directly into VLOOKUP. E.g =VLOOKUP(319,F1:G4,2,0), it works fine.

    Thanks in advance!
    Last edited by SCLai; 03-17-2011 at 10:38 PM.

  2. #2
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: VLOOKUP after Extracting

    Hi,

    It's likely the result of the LEFT function needs to be converted to a numerical value. Try this:

    =VLOOKUP(VALUE(LEFT(A1,3)),F1:G4,2,0)
    Cheers,
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  3. #3
    Forum Contributor SCLai's Avatar
    Join Date
    08-18-2010
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    129

    Re: VLOOKUP after Extracting

    Wow thanks its working fine now!
    I have tried "TEXT" but obviously it didnt work -_-"
    Thanks for the help again!

+ 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