+ Reply to Thread
Results 1 to 16 of 16

Hide zero if there is no value

  1. #1
    Registered User
    Join Date
    01-06-2014
    Location
    Kanyakumari, India
    MS-Off Ver
    Excel 2013
    Posts
    15

    Hide zero if there is no value

    Hi friends I cant find solution for this, So pls let me know.


    . A B C
    1 20 15 5
    2 10 10 0
    3 0
    4 0
    5 0
    6 0
    7 0
    8 0
    9 0
    10 0


    Pls look above,

    The formula entered in C1 is A1-B1 and the cell C1 is fill down up to C10
    I have entered values in rows only A and B. And when fill down C all the cells are showing zero. If I hide zero values the cell C2 that also hidden. I want the cell C2 should show zero because it has value. The other rows from 3 to 10 doesn't have values ans it should hide the zero from C3 to C10. I will input values in row 3 to 10 later.

    Please any one explain me the solution

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Hide zero if there is no value

    when you say "hide zeros" do you mean hide the rows or leave the rows existing but show blank in the cells?
    If someone has helped you then please add to their Reputation

  3. #3
    Valued Forum Contributor
    Join Date
    08-04-2011
    Location
    UK
    MS-Off Ver
    Excel 2021
    Posts
    346

    Re: Hide zero if there is no value

    how about change C1 to =if(A1=0,"",A1-B1)

  4. #4
    Registered User
    Join Date
    01-06-2014
    Location
    Kanyakumari, India
    MS-Off Ver
    Excel 2013
    Posts
    15

    Re: Hide zero if there is no value

    leave the rows existing but it should show blank cell

  5. #5
    Registered User
    Join Date
    01-06-2014
    Location
    Kanyakumari, India
    MS-Off Ver
    Excel 2013
    Posts
    15

    Re: Hide zero if there is no value

    Thanks a lot... worked what I expected partially

    Even column B have any value the result is blank

    I need the result should be shown in C1 if any of one cell either A1 or B1 have values.
    Last edited by neokragu; 12-13-2014 at 05:14 AM.

  6. #6
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,330

    Re: Hide zero if there is no value

    =if(count(A1:B1)=0,"",A1-B1)

    Try this
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  7. #7
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Hide zero if there is no value

    If A or B is 0 th3n be blank otherwise get the difference of A - B

    Please Login or Register  to view this content.
    -If you think you are done, Start over - ELeGault

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Hide zero if there is no value

    =if(or(a1="",b1=""),"",a1-b1)
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  9. #9
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Hide zero if there is no value

    MartinDWilson : "
    Please Login or Register  to view this content.
    "
    Agreed, if they have an actual 0 in place it will ignore it so A = 10 and B = 0 C should = 10 where my previous suggestion blanks it out - good catch!

    Martin's update is the one you want!

    Please Login or Register  to view this content.

  10. #10
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Hide zero if there is no value

    In light of the OP's statement "I need the result should be shown in C1 if any of one cell either A1 or B1 have values", this is my interpretation:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    A
    B
    C
    1
    1
    1
    0
    2
    1
    -1
    3
    0
    4
    0
    0
    5
    1
    -1
    6
    1
    1
    7
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  11. #11
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Hide zero if there is no value

    In light of the OP's statement "I need the result should be shown in C1 if any of one cell either A1 or B1 have values", this is my interpretation:
    SMH - you would be correct sir , all though what if you wanted to do a 0 - 0 or 5 - (-1)... we would exclude negative integers and results if you actually put 0 in both columns as you did in row 4... in which case we may go back to what Popino was doing with a small alteration...

    Please Login or Register  to view this content.
    This would give result
    \ A B C
    1 0 0
    2 0 0 0
    3 3 3
    4 0 1 -1
    5 -2 1 -3
    6

    This allows negative integers in A/B as well

  12. #12
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Hide zero if there is no value

    Confusion reigns. Here is another way to do what I think the OP wants.

    A
    B
    C
    1
    1
    1
    0
    2
    1
    -1
    3
    0
    4
    0
    0
    5
    -2
    1
    -3
    6
    1
    -1
    7
    1
    1
    8
    -4
    7
    -11
    9
    12
    9
    3
    10
    0
    11
    =IF(OR(A1<>0,B1<>0),A1-B1,"")

  13. #13
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Hide zero if there is no value

    HAHAHA - I like it - OP, please weigh in and let us know if you have what you need... I think there are several solutions and one is bound to do the trick for you

  14. #14
    Forum Contributor
    Join Date
    09-18-2014
    Location
    Pakistan
    MS-Off Ver
    2013, 2016
    Posts
    283

    Re: Hide zero if there is no value

    Good Reply. Helpful

  15. #15
    Registered User
    Join Date
    06-28-2012
    Location
    India
    MS-Off Ver
    Excel 2013 and Excel 365
    Posts
    76

    Re: Hide zero if there is no value

    Go to "excel option">>> Click on "Advanced", Untick the option "Show a zero in cell that have zero value"

  16. #16
    Registered User
    Join Date
    01-06-2014
    Location
    Kanyakumari, India
    MS-Off Ver
    Excel 2013
    Posts
    15

    Re: Hide zero if there is no value

    Quote Originally Posted by popipipo View Post
    =if(count(A1:B1)=0,"",A1-B1)

    Try this
    Thank you very much. This is exactly what I want. Tested, working as expected.

    Thank you all for those gave your suggestions.

+ 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] Hide specific Rows in Sheet1 + hide 5 more in Sheet2
    By bluesurger in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 06-02-2014, 07:19 AM
  2. Disable/Hide Insert, Delete and Hide commands
    By nateinoh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-14-2013, 10:49 AM
  3. VBA hide row based on pull down with button to toggle show/hide
    By myronr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-12-2012, 06:07 PM
  4. HIDE ZEROS IN CHART - Hide rows of cells that equals zero
    By sweedey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-09-2011, 08:18 PM
  5. Query Hide State of Column Ranger and Hide if False
    By Orson100 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-18-2009, 07:51 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