Consulting

Results 1 to 3 of 3

Thread: Solved: Preventing N/A# in Vlookup?

  1. #1
    VBAX Regular
    Joined
    Jun 2008
    Posts
    16
    Location

    Solved: Preventing N/A# in Vlookup?

    Just a quick one hopefully, but I have been unable to find the answer on my own.

    I want to change the default behaviour of a vlookup function, so that if the lookup value is not found, instead of populating the cell with "#N/A" it simply leaves it blank.

    This should be easy and I have tried IF(vlookup(A1,C5:E10,2)="N/A","",vlookup(A1,C5:E10,2) but it doesn't work.

    Can anyone tell me what is the correct way of referencing the "#N/A" so that I can replace it with a "".

  2. #2
    VBAX Regular
    Joined
    Jun 2008
    Posts
    16
    Location
    Apologies.

    Obiously I should be using ISERROR.

  3. #3
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    Yes or use ISNA:
    =IF(ISNA(VLOOKUP(A1,C5:E10,2)),"",VLOOKUP(A1,C5:E10,2))
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •