+ Reply to Thread
Results 1 to 5 of 5

Vlook up not capturing all numbers

  1. #1
    Forum Contributor
    Join Date
    07-31-2009
    Location
    Lincoln, USA
    MS-Off Ver
    Excel 2007 and excel 2010
    Posts
    142

    Vlook up not capturing all numbers

    Hello - this one just has me stumped and it has to be simple.

    I have a workbook with 2 sheets

    Main Sheet
    School Codes

    I'm just trying to do a basic Vlookup to compaire the two sheets.

    The Issue = Numbers are in Column A on both Tabs but the Vlook up is still returning #N/A for the last 20 or so.

    I've attached an example with PII removed so please point out my stupidity.

    thanks.
    Attached Files Attached Files
    Last edited by fireguy7; 01-30-2013 at 02:57 PM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Vlook up not capturing all numbers

    You have spaces after the School Codes in column A on sheet 'Main sheet'.
    If posting code please use code tags, see here.

  3. #3
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Vlook up not capturing all numbers

    to get rid of spaces I suggest to insert the formula in column C of school codes =trim(a...) copy and paste values into column a . also there are codes that do not exist in the list

  4. #4
    Forum Contributor
    Join Date
    07-31-2009
    Location
    Lincoln, USA
    MS-Off Ver
    Excel 2007 and excel 2010
    Posts
    142

    Re: Vlook up not capturing all numbers

    I was actually just being dumb - it was trailing spaces on the numbers that was causing them not to show. A simple Trim formula fixed the problem.

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Vlook up not capturing all numbers

    select column A /data /text to columns /fixed width ,click next click next again ,choose text from column data format, click finish
    or select from a2 to a162 find space replace with nothing
    or
    use
    =VLOOKUP(TRIM(A2),'School codes'!A:A,1,FALSE)
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ 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