+ Reply to Thread
Results 1 to 8 of 8

Vlookup using first 4 characters

  1. #1
    Forum Contributor
    Join Date
    08-23-2010
    Location
    Staten Island, NY
    MS-Off Ver
    Excel 2003
    Posts
    242

    Vlookup using first 4 characters

    I am trying to use this formula to do a vlookup using only the first 4 digits of the cell. However it is coming up as N/A. Anyone have any ideas of how to do this?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Vlookup using first 4 characters

    Do you mean that the strings in the customers range, 3rd column only have 4 digits?

  3. #3
    Forum Contributor
    Join Date
    08-23-2010
    Location
    Staten Island, NY
    MS-Off Ver
    Excel 2003
    Posts
    242

    Re: Vlookup using first 4 characters

    For my purposes yes. At my company we have customers (bill to) and each customer may have many ship to addresses. Customers are always 4 digit numbers. Ship-tos on the other hand, precede with the 4 digit number of its parent and then 1 or 2 letters. An example would be Cust#7777 and Ship-to#7777A.

    the column that I am doing left on is the ship-to number and the list that I am looking up the information is the Customer list. I want to pull some information that is stored with the customer (the parent) but not stored with the ship-to.

  4. #4
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Vlookup using first 4 characters

    Ooops, I meant 1st col of course . The N/A suggests no value was found? Maybe post a small sample?

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Vlookup using first 4 characters

    LEFT function always returns a text result, try like this to convert to numeric

    =VLOOKUP(LEFT(A5,4)+0,Customers,3,FALSE)
    Audere est facere

  6. #6
    Forum Contributor
    Join Date
    08-23-2010
    Location
    Staten Island, NY
    MS-Off Ver
    Excel 2003
    Posts
    242

    Re: Vlookup using first 4 characters

    That fixed it - is there a way to mark complete?

  7. #7
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Vlookup using first 4 characters

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  8. #8
    Registered User
    Join Date
    06-27-2014
    Location
    US
    MS-Off Ver
    2010
    Posts
    1

    Re: Vlookup using first 4 characters

    HI - I registered just to say thank you for this post - it fixed exactly what I needed!!!!

    EDIT - I meant to thank Daddy Longlegs

+ 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