+ Reply to Thread
Results 1 to 18 of 18

show a blank cell instead of 0 when displying lookup function result

  1. #1
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    show a blank cell instead of 0 when displying lookup function result

    I've got a lookup function that sometimes will not find any matching values and thus display a zero as the result. Is there a way to format a cell to simply show a blank cell when this happens? Just don't want to see a zero.

    Thanks
    You either quit or become really good at it. There are no other choices.

  2. #2
    Valued Forum Contributor
    Join Date
    05-14-2012
    Location
    Unknown
    MS-Off Ver
    Unseen
    Posts
    429

    Re: show a blank cell instead of 0 when displying lookup function result

    A lookup that failed to find a match would normally return #N/A. So, what have you done to avoid that? If there is a match but the value returned is zero, that probably means the cell to be returned is empty/blank.

    If the cell to be returned has alphanumeric content, you could just add
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    that's ampersand double quotes double quotes. Otherwise, you will need to test the value returned for blank.

  3. #3
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Re: show a blank cell instead of 0 when displying lookup function result

    Doh! My apologies. I am using the index function instead of lookup, which basically returns the value of the row so =index(A1:A10,3) will return 0 if A3 is blank. I am aware of using "", but would like to avoid increasing the length of the formula as I have many of these.

  4. #4
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: show a blank cell instead of 0 when displying lookup function result

    You can't change the functionality of the formula without adding bits to it.

    You could use conditional formatting to hide zero values by setting the font colour the same as the fill colour, but that would hide true zeros as well as those returned by empty cells.

    edit:-

    There is also an option 'Show a zero in cells that have a zero value' which can be applied to the whole worksheet (sheet, not book, so applying it to Sheet1 would still allow zeros to be shown on sheet2).

    File - Excel Options - Advanced - Display options for this worksheet (select relevant sheet from dropdown).

    second edit:-

    InvisibleMan has provided a link with more info on this while I was typing my first edit.
    Last edited by jason.b75; 03-24-2016 at 08:54 PM.

  5. #5
    Valued Forum Contributor
    Join Date
    05-14-2012
    Location
    Unknown
    MS-Off Ver
    Unseen
    Posts
    429

    Re: show a blank cell instead of 0 when displying lookup function result

    https://support.office.com/en-gb/art...hide_zero_valu

    It will, of course, hide genuine zero values.

  6. #6
    Valued Forum Contributor
    Join Date
    05-14-2012
    Location
    Unknown
    MS-Off Ver
    Unseen
    Posts
    429

    Re: show a blank cell instead of 0 when displying lookup function result

    You can't change the functionality of the formula without adding bits to it.
    Well said

  7. #7
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Re: show a blank cell instead of 0 when displying lookup function result

    Quote Originally Posted by InvisibleMan View Post
    https://support.office.com/en-gb/art...hide_zero_valu

    It will, of course, hide genuine zero values.
    That works. Thanks!

  8. #8
    Valued Forum Contributor
    Join Date
    05-14-2012
    Location
    Unknown
    MS-Off Ver
    Unseen
    Posts
    429

    Re: show a blank cell instead of 0 when displying lookup function result

    You're welcome. Thanks for the rep.

  9. #9
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: show a blank cell instead of 0 when displying lookup function result

    Personally, I would go with the longer formula, for example

    =IF(LEN(INDEX(A1:A10,3)&""),INDEX(A1:A10,3),"")

    Which should cater for all data types (except formula errors).

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: show a blank cell instead of 0 when displying lookup function result

    If the value being returned is TEXT...

    =T(INDEX(A1:A10,3))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  11. #11
    Valued Forum Contributor
    Join Date
    05-14-2012
    Location
    Unknown
    MS-Off Ver
    Unseen
    Posts
    429

    Re: show a blank cell instead of 0 when displying lookup function result

    In terms of length of formula, there's not a lot in it

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  12. #12
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: show a blank cell instead of 0 when displying lookup function result

    Quote Originally Posted by InvisibleMan View Post
    =INDEX(A1:A10,3)&""
    If the values being returned where numbers you wouldn't want to use that technique. That will convert them into text values.

  13. #13
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: show a blank cell instead of 0 when displying lookup function result

    Quote Originally Posted by Tony Valko View Post
    If the values being returned where numbers you wouldn't want to use that technique. That will convert them into text values.
    If the values being returned were numbers, you wouldn't want to use T() either. That will leave you with a sheet full of blanks.

  14. #14
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: show a blank cell instead of 0 when displying lookup function result

    Quote Originally Posted by jason.b75 View Post
    If the values being returned were numbers, you wouldn't want to use T() either.
    Right, that's why I qualified my response with:

    If the value being returned is TEXT...

  15. #15
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: show a blank cell instead of 0 when displying lookup function result

    I guess we're both guilty of not scrolling back far enough to check all of the relevant information in previous posts.

    Quote Originally Posted by InvisibleMan View Post
    If the cell to be returned has alphanumeric content, you could just add
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    that's ampersand double quotes double quotes. Otherwise, you will need to test the value returned for blank.
    On the basis that excel handles alphanumeric entries as text strings, not numeric values, I read this as qualifying the use of &"" in the same way, otherwise I would have pointed out the potential issue it could cause in post #4.
    Last edited by jason.b75; 03-25-2016 at 11:10 AM.

  16. #16
    Valued Forum Contributor
    Join Date
    05-14-2012
    Location
    Unknown
    MS-Off Ver
    Unseen
    Posts
    429

    Re: show a blank cell instead of 0 when displying lookup function result

    If the values being returned where numbers you wouldn't want to use that technique. That will convert them into text values.
    I was simply comparing the length of the formulae, not the impact of using them.

    I originally said:
    If the cell to be returned has alphanumeric content, you could just add
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    And I supplemented that by saying
    Otherwise, you will need to test the value returned for blank.

  17. #17
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: show a blank cell instead of 0 when displying lookup function result

    OK, looks like we covered all the bases on this one.

    Next...

  18. #18
    Valued Forum Contributor
    Join Date
    05-14-2012
    Location
    Unknown
    MS-Off Ver
    Unseen
    Posts
    429

    Re: show a blank cell instead of 0 when displying lookup function result

    yeah, I think so

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How to show cell blank if no value in lookup table
    By PhilBar in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-07-2016, 04:28 PM
  2. lookup with one result show 0 only: funny bug attached file
    By DavidRoger in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-11-2014, 06:14 AM
  3. [SOLVED] Displying Blank Cell in Dependent List
    By sajanpatel15 in forum Excel General
    Replies: 2
    Last Post: 07-11-2013, 01:36 PM
  4. lookup value and show last cell not blank
    By tonnerre2000 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-07-2013, 07:30 PM
  5. Replies: 1
    Last Post: 02-27-2011, 08:55 PM
  6. Using if function to show blank when cell in other sheet is empty
    By Billznik in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-08-2006, 10:46 PM
  7. Replies: 1
    Last Post: 04-10-2006, 04:15 AM

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