+ Reply to Thread
Results 1 to 23 of 23

How to make a zero not show when connected to a formula?

  1. #1
    Forum Contributor
    Join Date
    11-23-2013
    Location
    San Diego
    MS-Off Ver
    Excel 2013
    Posts
    457

    How to make a zero not show when connected to a formula?

    In my attached worksheet, I have a list of 10 names with projected stats for 2015. Each name falls under either a Hitting Projection or Pitching Projection based on what position they play.

    For example, the first name on the list is a hitter so his pitching projections stats should be blank instead they are showing up as zeros. I have formulas in those cells in my master copy but couldn't leave the formulas here because it's pulling from another file on my hard drive.

    For cell AE13, my formula is as follows...=IFERROR(INDEX('Player Database'!$FB$12:$FB$1625,MATCH(C13,'Player Database'!$C$12:$C$1625,0))," ") but yet for some reason it's returning an error as a zero instead of a blank. Anyone know why?

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: How to make a zero not show when connected to a formula?

    Try this formula

    ***Untested

    =IFERROR(1/(1/INDEX('Player Database'!$FB$12:$FB$1625,MATCH(C13,'Player Database'!$C$12:$C$1625,0))),"")
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: How to make a zero not show when connected to a formula?

    Your formula wIll return an error only if C3 contains a value that isn't in column C of your raw data (and your iferror statement will hide it). If it IS present, but theres a zero or blank value associated with it in column FB of your raw data, it will return a 0. To get rid of it, use this:

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




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: Lá fhéile Pádraig sona dhaoibh

  4. #4
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: How to make a zero not show when connected to a formula?

    or also

    =IFERROR(INDEX('Player Database'!$FB$12:$FB$1625,MATCH(C13,'Player Database'!$C$12:$C$1625,0)),"")&""

    Edit: the above will return as text strings
    Last edited by vlady; 02-11-2015 at 10:28 PM.
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  5. #5
    Forum Contributor
    Join Date
    11-23-2013
    Location
    San Diego
    MS-Off Ver
    Excel 2013
    Posts
    457

    Re: How to make a zero not show when connected to a formula?

    Quote Originally Posted by AlKey View Post
    Try this formula

    ***Untested

    =IFERROR(1/(1/INDEX('Player Database'!$FB$12:$FB$1625,MATCH(C13,'Player Database'!$C$12:$C$1625,0))),"")
    Yes that works, what did you do? Thanks!

  6. #6
    Forum Contributor
    Join Date
    11-23-2013
    Location
    San Diego
    MS-Off Ver
    Excel 2013
    Posts
    457

    Re: How to make a zero not show when connected to a formula?

    Quote Originally Posted by mlbdc2012 View Post
    Yes that works, what did you do? Thanks!
    The only problem is that this now makes a stat 0 for a hitter if they aren't projected to get any stats in that category. I guess there is nothing I can do about that unless there was a way for the formula to recognize what position the player plays and then either show the zero or make the zero show as blank. Anyway to do this?

  7. #7
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: How to make a zero not show when connected to a formula?

    When a formula returns a 0 the IFERROR function is not effective and therefore IFERROR(1/(1 where 1 is dived by 0 to create an error and now it will be remedied by IFERROR.


    another way is to use Conditional Formatting to hide zeros.

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: How to make a zero not show when connected to a formula?

    It now might be easier if we had a sample of your sheet to play with....

  9. #9
    Forum Contributor
    Join Date
    11-23-2013
    Location
    San Diego
    MS-Off Ver
    Excel 2013
    Posts
    457

    Re: How to make a zero not show when connected to a formula?

    Quote Originally Posted by Glenn Kennedy View Post
    It now might be easier if we had a sample of your sheet to play with....
    I attached my sheet in my first post.

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: How to make a zero not show when connected to a formula?

    Apologies for the cryptic comments. You HAD uploaded a sheet, but there are no raw data on that sheet and no formulas, so it wasn't/isn't much help!!

    Can you upload a small sample of representative data?

  11. #11
    Forum Contributor
    Join Date
    11-23-2013
    Location
    San Diego
    MS-Off Ver
    Excel 2013
    Posts
    457

    Re: How to make a zero not show when connected to a formula?

    Quote Originally Posted by Glenn Kennedy View Post
    Apologies for the cryptic comments. You HAD uploaded a sheet, but there are no raw data on that sheet and no formulas, so it wasn't/isn't much help!!

    Can you upload a small sample of representative data?
    Ok here's my newly attached file, I would like Clayton Kershaw and Felix Hernandez G and SB cells to be blank but still have Miguel Cabrera's 0 for SB show because he is a hitter. Kershaw and Hernandez are pitchers so they need to have their stats show up blank. Let me know if you have any questions. Thanks!
    Attached Files Attached Files

  12. #12
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: How to make a zero not show when connected to a formula?

    so clayton anf felix cannot have a value/score in that table ( Column T - Column AD) coz they are pitchers right?

    =IF(SUMPRODUCT(('Player Database'!$C$6:$C$15='Data Table'!$C13)*'Player Database'!$T$6:$AD$15)=0,"",IFERROR(INDEX('Player Database'!$AD$4:$AD$15,MATCH(C13,'Player Database'!$C$4:$C$15,0))," "))

    this will sum up the rows in Columns T to Ad for specific person and if it return 0 will show blank.


    ...
    Question how do you know if the player is pitcher or hitter?

  13. #13
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: How to make a zero not show when connected to a formula?

    so clayton anf felix cannot have a value/score in that table ( Column T - Column AD) coz they are pitchers right?

    =IF(SUMPRODUCT(('Player Database'!$C$6:$C$15='Data Table'!$C13)*'Player Database'!$T$6:$AD$15)=0,"",IFERROR(INDEX('Player Database'!$AD$4:$AD$15,MATCH(C13,'Player Database'!$C$4:$C$15,0))," "))

    this will sum up the rows in Columns T to Ad for specific person and if it return 0 will show blank.


    ...
    Question how do you know if the player is pitcher or hitter?

  14. #14
    Forum Contributor
    Join Date
    11-23-2013
    Location
    San Diego
    MS-Off Ver
    Excel 2013
    Posts
    457

    Re: How to make a zero not show when connected to a formula?

    Quote Originally Posted by vlady View Post
    so clayton anf felix cannot have a value/score in that table ( Column T - Column AD) coz they are pitchers right?

    =IF(SUMPRODUCT(('Player Database'!$C$6:$C$15='Data Table'!$C13)*'Player Database'!$T$6:$AD$15)=0,"",IFERROR(INDEX('Player Database'!$AD$4:$AD$15,MATCH(C13,'Player Database'!$C$4:$C$15,0))," "))

    this will sum up the rows in Columns T to Ad for specific person and if it return 0 will show blank.


    ...
    Question how do you know if the player is pitcher or hitter?
    The positions are listed in columns V:Y, anything that contains a P in it is a pitcher, so look at clayton and felix those are the only two pitchers on the list of 10 names.

  15. #15
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: How to make a zero not show when connected to a formula?

    so you can check it first like using if statement

    say from your original =IFERROR(INDEX('Player Database'!$FB$12:$FB$1625,MATCH(C13,'Player Database'!$C$12:$C$1625,0)),"")
    note that we are in row 13 so check row 13 column W for "P" - pitcher based on your sample file

    =if(W13="P","",IFERROR(INDEX('Player Database'!$FB$12:$FB$1625,MATCH(C13,'Player Database'!$C$12:$C$1625,0)),""))

  16. #16
    Forum Contributor
    Join Date
    11-23-2013
    Location
    San Diego
    MS-Off Ver
    Excel 2013
    Posts
    457

    Re: How to make a zero not show when connected to a formula?

    Quote Originally Posted by vlady View Post
    so you can check it first like using if statement

    say from your original =IFERROR(INDEX('Player Database'!$FB$12:$FB$1625,MATCH(C13,'Player Database'!$C$12:$C$1625,0)),"")
    note that we are in row 13 so check row 13 column W for "P" - pitcher based on your sample file

    =if(W13="P","",IFERROR(INDEX('Player Database'!$FB$12:$FB$1625,MATCH(C13,'Player Database'!$C$12:$C$1625,0)),""))
    What would it be if I wanted it to look up columns V:Y instead of just W in the beginning of the formula?

  17. #17
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: How to make a zero not show when connected to a formula?

    you mean if the "P" would be in any column of V, W or Y ?

    you can use countif

    =if(countif(V13:Y13,"P")>0,your index/match here,"")

  18. #18
    Forum Contributor
    Join Date
    11-23-2013
    Location
    San Diego
    MS-Off Ver
    Excel 2013
    Posts
    457

    Re: How to make a zero not show when connected to a formula?

    Quote Originally Posted by vlady View Post
    you mean if the "P" would be in any column of V, W or Y ?

    you can use countif

    =if(countif(V13:Y13,"P")>0,your index/match here,"")
    When I use that formula it gives me false. Here's the formula you sent me, let me know where it's off...

    =IF(COUNTIF(V13:Y13,"P")>0,IFERROR(INDEX('Player Database'!$T$12:$T$1625,MATCH($C13,'Player Database'!$C$12:$C$1625,0)),""))

  19. #19
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: How to make a zero not show when connected to a formula?

    you missed the quotes at the end
    the first quote belongs to the iferror function()
    =IF(COUNTIF(V13:Y13,"P")>0,IFERROR(INDEX('Player Database'!$T$12:$T$1625,MATCH($C13,'Player Database'!$C$12:$C$1625,0)),""),"")

  20. #20
    Forum Contributor
    Join Date
    11-23-2013
    Location
    San Diego
    MS-Off Ver
    Excel 2013
    Posts
    457

    Re: How to make a zero not show when connected to a formula?

    Quote Originally Posted by vlady View Post
    you missed the quotes at the end
    the first quote belongs to the iferror function()
    =IF(COUNTIF(V13:Y13,"P")>0,IFERROR(INDEX('Player Database'!$T$12:$T$1625,MATCH($C13,'Player Database'!$C$12:$C$1625,0)),""),"")
    Now it's showing a blank for the first guy instead of 160 like it should for Mike Trout. Any ideas?

  21. #21
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: How to make a zero not show when connected to a formula?

    =IF(COUNTIF(V13:Y13,"P")>0,"",IFERROR(INDEX('Player Database'!$AD$4:$AD$1625,MATCH(C13,'Player Database'!$C$4:$C$1625,0))," "))

  22. #22
    Forum Contributor
    Join Date
    11-23-2013
    Location
    San Diego
    MS-Off Ver
    Excel 2013
    Posts
    457

    Re: How to make a zero not show when connected to a formula?

    Quote Originally Posted by vlady View Post
    =IF(COUNTIF(V13:Y13,"P")>0,"",IFERROR(INDEX('Player Database'!$AD$4:$AD$1625,MATCH(C13,'Player Database'!$C$4:$C$1625,0))," "))
    Perfect thank you!

  23. #23
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: How to make a zero not show when connected to a formula?

    Your very much welcome.

    Regards,
    Vlady

+ 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. How to make an invalid formula show as nothing
    By mlbdc2012 in forum Excel General
    Replies: 4
    Last Post: 02-04-2015, 02:36 PM
  2. [SOLVED] New to VBA functions, How do you make your function show the steps to the formula
    By dbravo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-22-2014, 01:01 PM
  3. [SOLVED] How to make Macro to lock certain cells connected to another cells value, then copy daily
    By RamiSaydi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-29-2014, 12:41 PM
  4. Replies: 5
    Last Post: 12-11-2012, 06:03 PM
  5. Make Line chart not show (Contain Formula)
    By vietdieu in forum Excel General
    Replies: 1
    Last Post: 03-12-2012, 08:57 PM

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