+ Reply to Thread
Results 1 to 6 of 6

Thread: Vlookup that does not generate #N/A

  1. #1
    Registered User
    Join Date
    09-23-2010
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    23

    Lightbulb Vlookup that does not generate #N/A

    Hi all,

    Vlookup code I'm using:
    =VLOOKUP(a2,[MappingTables.xlsx]names!A:B,2,)
    Column A has abbreviated names.

    Mapping table has abbreviated names and full names.

    If name does not exist, vlookup writes "#N/A."

    I would like it to just copy the abbreviated name instead if name is not found.

    On a tight deadline, please help?
    Thank you!
    Last edited by contra76; 10-21-2010 at 11:19 PM.

  2. #2
    Forum Moderator daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2007
    Posts
    10,057

    Re: Vlookup that does not generate #N/A

    Try using IFERROR function, i.e.

    =IFERROR(VLOOKUP(A2,[MappingTables.xlsx]names!A:B,2,0),A2)
    Audere est facere

  3. #3
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    617

    Re: Vlookup that does not generate #N/A

    Quote Originally Posted by contra76 View Post
    Hi all,

    Vlookup code I'm using:
    =VLOOKUP(a2,[MappingTables.xlsx]names!A:B,2,)
    Column A has abbreviated names.

    Mapping table has abbreviated names and full names.

    If name does not exist, vlookup writes "#N/A."

    I would like it to just copy the abbreviated name instead if name is not found.

    On a tight deadline, please help?
    Thank you!
    Do the abreviated names have parts of the real name? IE looking up edinburgh in a2, =VLOOKUP(a2,[MappingTables.xlsx]names!A:B,2,)

    where A2 contains "*Edin*" and that works. but you would get a problem if there was partial names that were duplicated, edinburgh and edinside....

  4. #4
    Registered User
    Join Date
    09-23-2010
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Vlookup that does not generate #N/A

    Quote Originally Posted by daddylonglegs View Post
    Try using IFERROR function, i.e.

    =IFERROR(VLOOKUP(A2,[MappingTables.xlsx]names!A:B,2,0),A2)
    you guys amaze me time and time again. Thank you both for the reply. This works like a charm!

  5. #5
    Registered User
    Join Date
    09-23-2010
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Vlookup that does not generate #N/A

    I don't know why but this worked the other day and now it's populating "0s" instead of a blank. Remedy?

  6. #6
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: Vlookup that does not generate #N/A

    Do you mean if A2 is blank, you want a blank instead of a 0?

    If so,


    =IF(A2="","",IFERROR(VLOOKUP(A2,[MappingTables.xlsx]names!A:B,2,0),A2))
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

+ 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.2.0