+ Reply to Thread
Results 1 to 10 of 10

Vlookup returning 0

Hybrid View

  1. #1
    Registered User
    Join Date
    04-03-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Vlookup returning 0

    So I have a large table that I'm vlooking off of, and I'd like to return an empty cell instead of zero if the cell in the large table is empty.

    I know I can use the formula =if(vlookup(A1,C1:Z999999,1,false)="","",vlookup(A1,C1:Z999999,1,false)) , however, I'm concerned that this would double the computation time. Is there a faster way to do this that will prevent excel from doing the vlookup twice? Preferably without putting the vlookup in a different cell.

    Thanks!

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,055

    Re: Vlookup returning 0

    No, you must do that twice.
    But since you using 1 as column index you don't need VLOOKUP.

    You can try: =IF(COUNTIF($C:$C,A1)=0,"",A1)
    Last edited by zbor; 04-03-2012 at 09:37 AM.
    Never use Merged Cells in Excel

  3. #3
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Vlookup returning 0

    Hi gtdean11,

    Welcome to the forum.

    As per my knowledge, vlookup is generally slow as compared to Index - Match.. also just noticed that you are using Excel 2010.. why don't you use ISERROR function?

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  4. #4
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Vlookup returning 0

    Is that the actual formula you're using? VLOOKUP only does a look-up on the left-hand most column in an array, so specifying you're searching columns C-Z and then returning the information from column 1 means that you can only be returning a blank if your look-up value is blank. In which case you could use:

    =IF(A1="","",A1)

    That should use a lot less computational power.

  5. #5
    Registered User
    Join Date
    04-03-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Vlookup returning 0

    Thanks for your help!

    All: I gave a poor example of the formula. a more appropriate example would be =if(vlookup(A1,C1:Z999999,20,false)="","",vlookup(A1,C1:Z999999,20,false)). I'm not just looking to return the original value.

    Given that, it looks like the answer is "no it's not possible, but a combination of index and match would be faster"

    DILIPandey: how would the iserror function help, since it currently returns 0?

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Vlookup returning 0

    Hi,

    =ISERROR(INDEX(V:V,MATCH(A1,C:C,FALSE)),"")
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  7. #7
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,055

    Re: Vlookup returning 0

    This will still return 0 in case that there is a blank cell.

    I would go with two VLOOKUP function as gtdean11 assumed in a frist place

  8. #8
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Vlookup returning 0

    Sorry my apologies. It should have been an IFERROR not ISERROR. i.e.

    =IFERROR(INDEX(V:V,MATCH(A1,C:C,FALSE)),"")

  9. #9
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Vlookup returning 0

    That will still return a zero, because the VLOOKUP isn't generating an error.

    If all of the returned values are whole numbers or text you could use:

    =TEXT(VLOOKUP(A1,C1:Z999999,20,FALSE),"#")

  10. #10
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Vlookup returning 0

    Hi gtdean,

    why don't you use ISERROR function?
    Typo: I meant IFERROR function since you are using Excel 2010. Same has been been explained by Richard as well in post#8.

    Thanks Richard.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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