+ Reply to Thread
Results 1 to 4 of 4

nesting in vlookup

  1. #1
    Forum Contributor
    Join Date
    09-19-2004
    Posts
    252

    nesting in vlookup

    I'm trying to use vlookup and have a column that shows the first two characters of a possible part number. I want to enter the part number in a cell and in the cell next to it have vlookup grab the first two characters of that part number and compare it to the reference. So, I'm trying to use left in my vlookup formula only it's giving me a #n/a error. Here is my vlookup formula:
    =VLOOKUP((LEFT(B4,2)),A19:L26,5,FALSE)

    If I replace the (LEFT(B4,2)) with the number 25 (the first two digits of the part number in cell B4) I get a value but when I put the (LEFT(B4,2)) back into the formula it doesn't work. Does VLOOKUP not play well with other formulas?

  2. #2
    Forum Contributor
    Join Date
    09-19-2004
    Posts
    252
    I just noticed, if I do this
    =VLOOKUP(25,A10:L17,5,FALSE)
    I get a value but then I put this in cell B2
    =LEFT(B4,2)
    and change my vlookup
    =VLOOKUP(B2,A10:L17,5,FALSE)
    and get a #N/A. I wonder why???

  3. #3
    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
    Try

    LEFT(B4,2)+0
    +0 should convert to a number

    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 !!!

  4. #4
    Forum Contributor
    Join Date
    09-19-2004
    Posts
    252
    Beautiful! Thank you so much.
    Last edited by DKY; 01-17-2008 at 05:04 PM.

+ 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