Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-18-2011, 12:24 AM
Helu Helu is offline Zero (0) in cell Windows XP Zero (0) in cell Office 2003
Novice
Zero (0) in cell
 
Join Date: Jan 2011
Posts: 1
Helu is on a distinguished road
Default Zero (0) in cell


Hi.
If you have a cell with a formula, and the input cells are empty, this cell will show a zero (0).
In the cell formating box you can define that this zero should not be shown, but I can't remember!
Please, can anyone help??
Reply With Quote
  #2  
Old 01-18-2011, 01:16 PM
ConneXionLost's Avatar
ConneXionLost ConneXionLost is offline Zero (0) in cell Windows XP Zero (0) in cell Office 2003
Simulacrum
 
Join Date: Jan 2010
Location: Victoria, Canada
Posts: 86
ConneXionLost is on a distinguished road
Default

You can use a custom format like this:

Code:
#,##0_);(#,##0);""
but, be warned, it will hide ALL zeros.

Cheers,
Reply With Quote
  #3  
Old 01-18-2011, 07:17 PM
Kaneto Kaneto is offline Zero (0) in cell Windows 7 Zero (0) in cell Office 2010 (Version 14.0)
Competent Performer
 
Join Date: Nov 2010
Posts: 136
Kaneto is on a distinguished road
Default

You should be able to do it with Conditional Formatting.

Basically, select the entire worksheet, then click Format > Conditional Formatting.
For the condition, it will be When Cell Value Equals 0
Then for the formatting when the condition is true, just make the text white. The zero will still be there, but it wont be viewable against the white background.

-SW
Reply With Quote
  #4  
Old 01-18-2011, 07:26 PM
macropod's Avatar
macropod macropod is offline Zero (0) in cell Windows 7 32bit Zero (0) in cell Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,373
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by ConneXionLost View Post
You can use a custom format like this:

Code:
#,##0_);(#,##0);""
but, be warned, it will hide ALL zeros.
No, it'll only hide 0s in the cells to which the custom format is applied.

An alternative is to modify the formula. For example:
=IF(A1+B1=0,"",A1+B1)
or:
IF(OR(A1=0,B1=0),"",A1+B1)
The first hides the result only if it evaluates to 0, whereas the second hides the result if either of the inputs is 0.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 01-18-2011, 09:29 PM
ConneXionLost's Avatar
ConneXionLost ConneXionLost is offline Zero (0) in cell Windows XP Zero (0) in cell Office 2003
Simulacrum
 
Join Date: Jan 2010
Location: Victoria, Canada
Posts: 86
ConneXionLost is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
No, it'll only hide 0s in the cells to which the custom format is applied.
Please note the OP's question; the part where it refers to "cell formatting".

Also,

Quote:
Originally Posted by macropod View Post
IF(OR(A1=0,B1=0),"",A1+B1)
Your formula would work better as:

Code:
IF(AND(A1=0,B1=0),"",A1+B1)
to avoid the embarrassment of 0+4=""
Reply With Quote
  #6  
Old 01-18-2011, 09:47 PM
macropod's Avatar
macropod macropod is offline Zero (0) in cell Windows 7 32bit Zero (0) in cell Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,373
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by ConneXionLost View Post
Please note the OP's question; the part where it refers to "cell formatting".
Your point being?

Your advice:
Quote:
it will hide ALL zeros
is plain wrong. It will only hide 0s in the cells to which the custom format is applied - not all cells in the worksheet.

As for:
Quote:
Originally Posted by ConneXionLost View Post
Your formula would work better as:

Code:
IF(AND(A1=0,B1=0),"",A1+B1)
to avoid the embarrassment of 0+4=""
I was quite deliberate in using the OR statement, for the reasons I gave. With your variant, if -A1=B1, you'll still get a 0 display.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 01-19-2011, 03:44 AM
Colin Legg's Avatar
Colin Legg Colin Legg is offline Zero (0) in cell Windows 7 32bit Zero (0) in cell Office 2010 32bit
Expert
 
Join Date: Jan 2011
Location: UK
Posts: 369
Colin Legg will become famous soon enough
Default

The way I interpret the question (and I could be wrong!) is if all of the precedent cells are empty then to 'not display a result', whilst if any of the cells contain a number then a result should be displayed (including 0 if that is a result).

To do that I'd use a formula (or variation thereof) like this:
Code:
=IF(COUNT(C3:D3),SUM(C3:D3),"")
Although, to be honest, the empty string causes problems if further arithmetic is performed from it. In my worksheets, I'd keep it simple and just display the 0 all of the time.

My 2c...
Reply With Quote
  #8  
Old 01-19-2011, 12:24 PM
ConneXionLost's Avatar
ConneXionLost ConneXionLost is offline Zero (0) in cell Windows XP Zero (0) in cell Office 2003
Simulacrum
 
Join Date: Jan 2010
Location: Victoria, Canada
Posts: 86
ConneXionLost is on a distinguished road
Default

macropod,

Quote:
Originally Posted by macropod View Post
Your point being?
Apparently lost with you.

Quote:
Originally Posted by macropod View Post
Your advice:
is plain wrong. It will only hide 0s in the cells to which the custom format is applied - not all cells in the worksheet.
The OP did not ask to hide all 0s in the worksheet, only the "cell with a formula" by way of the "cell formating box". It was Kaneto that suggested the "entire worksheet" for conditional formatting. My suggestion was only intended for the formula cell; at least we agree on that. My warning was that relying on a custom format would also hide a zero result from the formula (if the result is meant to be zero) and not just from the input cells being blank.

Quote:
Originally Posted by macropod View Post
I was quite deliberate in using the OR statement, for the reasons I gave. With your variant, if -A1=B1, you'll still get a 0 display.
As I said, sometimes the result is supposed to be "0", which is why I included the warning about the custom format. However with the OR statement in your example, if A1=0 and B1=4, your result would be "" instead of "4". Now that is "plain wrong".
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I fill cell color starting from Cell D5 using Conditional formatting instead Learner7 Excel 0 07-08-2010 05:50 AM
How can I make a cell color RED under the Today's date cell? Learner7 Excel 2 07-08-2010 12:52 AM
Help reg Protection of cell. aligahk06 Excel 1 09-02-2009 05:45 PM
Zero (0) in cell Cell formatting Niko Excel 5 04-23-2009 12:05 AM
Auto-populate an MS Word table cell with text from a diff cell? dreamrthts Word Tables 0 03-20-2009 01:49 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:00 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft