+ Reply to Thread
Results 1 to 6 of 6

How to hide a '0' showing in a cell if no data entered

Hybrid View

  1. #1
    Registered User
    Join Date
    09-08-2010
    Location
    Montenegro
    MS-Off Ver
    365
    Posts
    82

    Re: How to hide a '0' showing in a cell if no data entered

    Several solutions for this simple questions; here is my penny; I personally always use DonkeyOte's method, with two variations: sometimes I want destination cell to show value as soon as one of the cells is filled in; but sometimes I want all cells to be filled in before value in destination cell is shown; so I use these formulas:

    =IF(OR(E28="",F28="",G28="",H28=""),"",SUM(E28:H28)/4)

    =IF(AND(E28="",F28="",G28="",H28=""),"",SUM(E28:H28)/4)

    Obviously, the second one produces the same result as DonkeyOte's formula, with exception that his one is simpler, but first one will keep the cell empty untill all four related cells are filled in.

    Edit: BTW, why SUM(E28:H28)/4; why not just AVERAGE(E28:H28) ? That way, if you add new columns in between E and H, they will be automatically included in average, you won't have to edit the formula.
    Last edited by froment; 10-06-2010 at 10:26 AM.

  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 hide a '0' showing in a cell if no data entered

    Quote Originally Posted by froment
    first one [or based] will keep the cell empty untill all four related cells are filled in.
    @froment

    If the intention is to average then we assume values are to be numeric in which case the below might be simpler:

    =IF(COUNT(E28:H28)<4,"",SUM(E28:H28)/4)
    or as you say

    =IF(COUNT(E28:H28)<4,"",AVERAGE(E28:H28))
    I think the point about use of AVERAGE is more than valid though at this stage we don't know if 3 numbers and a blank should say result in divisor of 3 or 4 ?
    The answer to that determines viability of AVERAGE versus fixed divisor I think.

    Whilst I am here... regards the other suggestions, FWIW, my two pennies:

    Conditional Formatting is Super Volatile so I would always use this as method of last resort.
    In this instance given the singular condition - if the intention is to "mask" whilst maintaining underlying numeric I would say a Number Format would be preferable.

    Display Zeroes option - I would just add the caveat that this is a worksheet level setting and as such may / may not be appropriate.

+ 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