+ Reply to Thread
Results 1 to 6 of 6

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:
    Please Login or Register  to view this content.
    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 Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    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
    629

    Re: Vlookup that does not generate #N/A

    Quote Originally Posted by contra76 View Post
    Hi all,

    Vlookup code I'm using:
    Please Login or Register  to view this content.
    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 Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    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))
    Where there is a will there are many ways.

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

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

+ 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