+ Reply to Thread
Results 1 to 9 of 9

How to get VLOOKUP to return zero is not found???

  1. #1
    Registered User
    Join Date
    03-25-2009
    Location
    Rocky Top
    MS-Off Ver
    Excel 2003
    Posts
    5

    How to get VLOOKUP to return zero is not found???

    I'm using VLOOKUP to search for results in another worksheet. What I need is 0 returned if the search fails. Currently I'm getting #N/A and that's causing my other formulas to fail.
    Any suggestions???
    TIA
    Last edited by Tanasi; 03-27-2009 at 12:04 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: How to get VLOOKUP to return zero is not found???

    A couple...

    =IF(ISNA(VLOOKUP(....)),0,VLOOKUP(....))

    or assuming results of VLOOKUP when found are numeric then another alternative:

    =LOOKUP(9.99999999999999E+307,CHOOSE({1,2},0,VLOOKUP(...)))

  3. #3
    Registered User
    Join Date
    03-25-2009
    Location
    Rocky Top
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: How to get VLOOKUP to return zero is not found???

    Quote Originally Posted by DonkeyOte View Post
    A couple...

    =IF(ISNA(VLOOKUP(....)),0,VLOOKUP(....))

    or assuming results of VLOOKUP when found are numeric then another alternative:

    =LOOKUP(9.99999999999999E+307,CHOOSE({1,2},0,VLOOKUP(...)))
    I don't even understand your answer, I guess my vast lack of knowledge is more than showing.
    My current formula is:
    =VLOOKUP(C1,'IMPORT-A'!A:H,3,0)
    If not found I would like the result to be 0(zero).

    Please forgive my ignorance.

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: How to get VLOOKUP to return zero is not found???

    In the first suggestion simply replace the references to VLOOKUP(...) with your own VLOOKUP, ie:

    =IF(ISNA(VLOOKUP(C1,'Import-A'!A:H,3,0)),0,VLOOKUP(C1,'Import-A'!A:H,3,0))

    Note: given you're pulling Column C you need not reference A:H you could just reference A:C thereby reducing dependencies... you could use INDEX/MATCH to reduce further but that's for another day.

  5. #5
    Registered User
    Join Date
    03-25-2009
    Location
    Rocky Top
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: How to get VLOOKUP to return zero is not found???

    Quote Originally Posted by DonkeyOte View Post
    In the first suggestion simply replace the references to VLOOKUP(...) with your own VLOOKUP, ie:

    =IF(ISNA(VLOOKUP(C1,'Import-A'!A:H,3,0)),0,VLOOKUP(C1,'Import-A'!A:H,3,0))

    Note: given you're pulling Column C you need not reference A:H you could just reference A:C thereby reducing dependencies... you could use INDEX/MATCH to reduce further but that's for another day.
    My formula:
    =IF(ISNA(VLOOKUP(A2,'Import-A'!A:C,3,0)),0,(VLOOKUP(A2,'Import-A'!A:C,3,0)))
    Returns FALSE, how do I get the numeric value at that location to come over if false???

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: How to get VLOOKUP to return zero is not found???

    =--existing formula

    assumes results either numeric or logical (boolean true / false)

  7. #7
    Registered User
    Join Date
    03-25-2009
    Location
    Rocky Top
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: How to get VLOOKUP to return zero is not found???

    Apparently I thought this solved too soon.

    My current formula:
    =VLOOKUP(A1,'IMPORT-1'!A:C,3)
    no longer returns #N/A when the value in A1 isn't found in IMPORT-1 but instead returns the previous found value in the same column.

    What I need is if not found to get a 0(zero) and if found the value in that cell.

    I'm not married to VLOOKUP I just need something that works.

    TIA

  8. #8
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: How to get VLOOKUP to return zero is not found???

    Anyone would think this was rocket science..

    -- existing formula

    means

    =--IF(ISNA(VLOOKUP(A2,'Import-A'!A:C,3,0)),0,VLOOKUP(A2,'Import-A'!A:C,3,0))

    using VLOOKUP withoug 0/FALSE as 4th argument will return different results - I would advise you check out XL Help on the VLOOKUP function.

  9. #9
    Registered User
    Join Date
    03-25-2009
    Location
    Rocky Top
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: How to get VLOOKUP to return zero is not found???

    Thanks, Now I understand what you were previously saying.
    Sorry to have bothered you, I shall refrain in the future.

+ 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