+ Reply to Thread
Results 1 to 4 of 4

Amending VLOOKUP when Lookup_Value not found

  1. #1
    Forum Contributor
    Join Date
    02-08-2005
    MS-Off Ver
    Microsoft 365
    Posts
    812

    Amending VLOOKUP when Lookup_Value not found

    I am using the VLOOKUP function to extract values from another worksheet. Can someone please suggest how I alter the function to return a blank cell when the Lookup_Value is not found in the worksheet from which I’m calling data?

    Thanks!
    Last edited by andrewc; 02-08-2011 at 12:41 PM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Amending VLOOKUP when Lookup_Value not found

    Nest it within an IF statement
    =IF(ISNA(VLOOKUP(.....),"",VLOOKUP(.....))
    ISNA returns True if your vlookup returns a #N/A error and False if it doesn't.
    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Amending VLOOKUP when Lookup_Value not found

    If using XL2007+

    =IFERROR(VLOOKUP(....),"")

    if using other versions...

    =IF(ISNA(Vlookup()),"",VLOOKUP())

    or

    =IF(ISNUMBER(MATCH(lookup_value,first_column_of_lookup_range,0)),Vlookup(),"")

    or, if result is supposed to be text:

    =Lookup(Rept("z",255),Choose({1,2},"",Vlookup()))

    or, if result is supposed to be number:

    =Lookup(9.9999e+307,Choose({1,2},0,Vlookup())) and format as Custom: 0;-0;;@
    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.

  4. #4
    Forum Contributor
    Join Date
    02-08-2005
    MS-Off Ver
    Microsoft 365
    Posts
    812

    Re: Amending VLOOKUP when Lookup_Value not found

    Thanks very much!

+ 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